Textbox, how to detect enter "key" event.

  • Thread starter Thread starter Boki
  • Start date Start date
B

Boki

Hi All,

Could you please advice that how to detect the enter "key" event....

due to I don't want another button to do "Go" function.....

Best regards,
Boki.
 
Respond to the Keypress event and look for an ASCII code of 13 (that's the
Enter key)
When you detect it (the 13) set it to 0 (zero) then proceed to do what you
want after that.
 
In the Textbox's KeyDown event, do something like this:

If e.KeyCode = System.Windows.Forms.Keys.Enter Then

<do some stuff>
else
<do something else or nothing at all>
end if

james
 
Bokki,

Try to use the Key Up event. You will be surprised how much information is
in the E.

Cor
 
Back
Top