Home All Groups Group Topic Archive Search About

Textbox, how to detect enter "key" event.

Author
28 Apr 2006 1:22 AM
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.

Author
28 Apr 2006 1:37 AM
Sam Malone
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.


Show quoteHide quote
"Boki" <bokit***@ms21.hinet.net> wrote in message
news:1146187333.832152.234130@i40g2000cwc.googlegroups.com...
> 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.
>
Author
28 Apr 2006 1:40 AM
james
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


Show quoteHide quote
"Boki" <bokit***@ms21.hinet.net> wrote in message
news:1146187333.832152.234130@i40g2000cwc.googlegroups.com...
> 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.
>
Author
28 Apr 2006 4:58 AM
Cor Ligthert [MVP]
Bokki,

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

Cor

Show quoteHide quote
"Boki" <bokit***@ms21.hinet.net> schreef in bericht
news:1146187333.832152.234130@i40g2000cwc.googlegroups.com...
> 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.
>