Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting lower case to upper case

Status
Not open for further replies.

vbtest5

IS-IT--Management
Nov 16, 2002
37
0
0
IN
Hi,

In VB6, I used the following code in KeyPress event of textbox to convert lowercase to uppercase:
if keyascii >=97 and keyascii<= 122 then
keyascii = keyascii -32
endif

What is the equivalent code in VB.NET?

Regards,
Varsha
 
You dont need this. There is a property of the textbox "CharacterCasing"....
 
To check it:

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar >= "a" AndAlso e.KeyChar <= "z" Then
MessageBox.Show("Lower hit")
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top