I just wat to trigger an event using the ENTER Button.. in VB 6.0 I'm just using the Keypress function and using the KeyAscii 13. How about in VB.Net
Printable View
I just wat to trigger an event using the ENTER Button.. in VB 6.0 I'm just using the Keypress function and using the KeyAscii 13. How about in VB.Net
What control are you using? Most controls in 2005 .net have a KeyDown event.
Here is a really basic exmaple of pressing the enter key on a text box:
vb Code:
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then MsgBox("HELLO") End If End Sub
Thanks.... I'll try it.. :wave: :wave: :wave:
Ok, don't forget to mark thread as resolved and rate posts when finished!