473,399 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Forcing Case in Textbox

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
6 1713
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
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
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
* "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
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
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
12
by: Ritz, Bruno | last post by:
hi in java i found that when a method has a throws clause in the definition, callers must either handle the exceptions thrown by the method they are calling or "forward" the exception to the...
6
by: Finn Newick | last post by:
By defining a style as follows: @media aural, handheld {td.layout {display:block;}} I'm hoping to linearise layout tables when viewed by screenreaders and handheld devices (it is also be in...
0
by: Robert Wille | last post by:
I have a number of very common queries that the optimizer plans a very inefficient plan for. I am using postgres 7.2.3. I vacuum hourly. I'm wonderingwhat I can do to make the queries faster. Here...
4
by: John Baker | last post by:
Hi: I have a query which supports a form. Te form is used to edit, update and change records in the table the query is based on. It all works fine EXCEPT that the "New" record (blank updatable...
3
by: Patrick Olurotimi Ige | last post by:
I have a hyperlink below:- <asp:HyperLink ID="Hyperlink2"NavigateUrl='<%#"AddToCart.aspx?productID=" & DataBinder.Eval(Container, "DataItem.ProductID") >Add</asp:HyperLink> And i want to force...
2
by: melanieab | last post by:
Hi, Before I go into detail, is there any way to force a button to get that dotted box on it that shows it's in focus? Just saying btn1.Focus(); isn't working for me. Btn1 is definitely the thing...
5
by: Bubo.virginianus | last post by:
Heya! I feel I'm beating an old horse to death with this question but I can't get around the problem. I want to update a text field on a form with a string from a VB module. I need...
3
by: Ken Fine | last post by:
I am using ASP.NET's CreateUserWizard control. I want to force the visitor to use a username and e-mail address that I am providing in programming, and I do not want the visitor to be able to edit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.