I wish to Validate entry in a textbox so that only uppercse text is entered. If Lowercase text i sentered I wish to convert it automatically to uppercase.

In vb6 - I could use the keypress event with keyascii.

For example - to convert to uppercase.
VB Code:
  1. If KeyAscii >= 97 And KeyAscii <= 122 Then
  2.             KeyAscii = KeyAscii - 32
  3.          End If

Looking at .net - I can do something similar,

VB Code:
  1. Private Sub txtJobCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtJobCode.KeyPress
  2.       If e.KeyChar.IsLower(e.KeyChar) Then
  3.          e.KeyChar.ToUpper(e.KeyChar)
  4.       End If
  5.  
  6.    End Sub

but I can't figure out how to reset the key that was pressed (The above example, doesnt change what was entered in the text box).

any ideas?