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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top