By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,854 Members | 869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,854 IT Pros & Developers. It's quick & easy.

Forcing Case in Textbox

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

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

txtName.CharacterCasing = CharacterCasing.Upper

txtName.CharacterCasing = CharacterCasing.Lower

Ken

----------------------

"Sidney Mark Croy" <sm****@juno.com> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #2

P: n/a
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

Sidney Mark Croy wrote:
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

Nov 20 '05 #3

P: n/a
You could simply use the CharacterCasing property of the textbox.

Thanks,
David J. Ricker II
"One Handed Man" <Bo****@Duck.net> wrote in message
news:bn**********@sparta.btinternet.com...
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

Sidney Mark Croy wrote:
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


Nov 20 '05 #4

P: n/a
* "David Ricker" <da***@vanamatic.com> scripsit:
You could simply use the CharacterCasing property of the textbox.


That's the "preferred" way.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

P: n/a
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

Herfried K. Wagner [MVP] wrote:
* "David Ricker" <da***@vanamatic.com> scripsit:
You could simply use the CharacterCasing property of the textbox.


That's the "preferred" way.

Nov 20 '05 #6

P: n/a
* "One Handed Man" <Bo****@Duck.net> scripsit:
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 ;-)


:-)

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.