Textbox events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to validate the text in the textbox as the user enters them. If there
is a wildcard character the user's entry should be cleared. How do I do
this? I am having a problem in setting the keychar/keycode to vbkeyclear as
they are readonly. When I used VB6, I set keyascii to vbkeyclear. Can some
one help me on this one in VB.Net?
 
Hi,

e.Handled = true in the keypress event will prevent the key from
showing up. Hope this helps.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

e.Handled = (e.KeyChar = "*")

End Sub



Ken

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

I need to validate the text in the textbox as the user enters them. If
there
is a wildcard character the user's entry should be cleared. How do I do
this? I am having a problem in setting the keychar/keycode to vbkeyclear as
they are readonly. When I used VB6, I set keyascii to vbkeyclear. Can some
one help me on this one in VB.Net?
 
Back
Top