vb.net - tOGGLE cASE For Textbox? -


I can add toggle case to boxes, for example, I click on a button to turn it on To change the text in a text box in the case (hello -> hello), basically it takes the first letter and in the short cases this and the other upper case it matters

Here is a method to change the first title case using the net culture functions and then Your "Toggle case"

  private sub btn_ConvertTotOGGLEcASE_Click (as the object is to reverse the case for e EventArgs) handles btn_ConvertTotOGGLEcASE.Click title case convert ' find text box present value as dim MyText string = MyTextBox.Text the 'net device using "(made in as dim MyTextInfo System.Globalization.TextInfo = new System.Globalization.CultureInfo en-US", false) .TextInfo MyText = MyTextInfo.ToTitleCase (MyText) 'then all characters dim invertedText as four () = MyText.Select Case (reverse function (c) (CharkIsLetter (c), then (CharkIsUpper (c), CharkToLower (c), CharkToUpper (c)), c)). toArray () 'Finally convert it back to a string MyTextBox.Text = new String (inverted text) End Sub  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -