Forcing Case in Textbox

  • Thread starter Thread starter Sidney Mark Croy
  • Start date Start date
S

Sidney Mark Croy

Greetings

In VB6 you could change case to upper or lower within the KeyPress event
handling. How do you accomplish that within VB.NET?

Thank you

SMCroy
 
Hi,

The textbox has a charactercasing property. You can select upper,
lower, or none.

txtName.CharacterCasing = CharacterCasing.Upper

txtName.CharacterCasing = CharacterCasing.Lower

Ken
 
Also, you can use the string convert function

TextBox1.text = StrConv(TextBox1.text, VbStrConv.LowerCase)

There are a number of usefull conversions such as VbStrConv.ProperCase which
can be used also.

Regards and HTH

OHM'ster
 
You could simply use the CharacterCasing property of the textbox.

Thanks,
David J. Ricker II
 
Yes you could. BUT, there are only three variants on character casing.
Normal, Upper and Lower. My solution allows for more variations such as
proper case.

I think we had this discussion once before ;-)

Rehards OHM'ster
 
* "One Handed Man said:
Yes you could. BUT, there are only three variants on character casing.
Normal, Upper and Lower. My solution allows for more variations such as
proper case.

ACK. That's a limitation, but very often we don't need more that that.
I think we had this discussion once before ;-)

:-)
 
Back
Top