Question make textbox input UpperCased?

kreuznach

Member
Joined
Sep 21, 2009
Messages
5
Programming Experience
1-3
sorry if i ask dumb question... :eek:

i want to make all input in textbox become uppercase
example, if someone type v, the textbox will display "V" and then type b then textbox will display "VB" and so on...
so if someone type wahetever in lowercase or uppercase, the textbox will convert it to uppercase then display it on the screen...

please give me solution... thanks in advance... :D
 
Hi, is there anyway to do the same at run time without using:
VB.NET:
 Ucase(String)
You need to differentiate between what's a TextBox and what's a String. If you want the casing of a TextBox to be always upper case then you set the CharacterCasing to Upper, period. Whether you set it in the designer or in code doesn't matter. Afetr you set it the contents of the TextBox will always be upper case.

Making a String upper case is something else. If you want to create an all-upper-case copy of an existing String then you have to call a method. You could call Ucase but we're not VB6 developers anymore, so we would call the String's own ToUpper method, e.g.
VB.NET:
Dim str As String = "hello world"

MessageBox.Show(str)

str = str.ToUpper()

MessageBox.Show(str)
 
Back
Top