Question:
How to Simulate a Click on a Button by Pressing Enter on the Keyboard In VB.Net 2008?
JS71296
2009-09-30 05:25:06 UTC
Hello,

I would like to know how to Simulate a Click on a Button by Pressing Enter on the Keyboard In VB.Net 2008. I am working on a web browser, and would like to know how to do this.

Thank You,
JS71296
Four answers:
ajayx2001
2009-10-02 09:20:37 UTC
Create an event handler for the onKeyPress event of the textbox. Check whether "Enter key" was pressed or not. If enter was pressed, call the Button_Click event handler and let it handle. You can also check whether there is an event for enter press.
2009-09-30 06:15:12 UTC
If the button has the Default attribute set to True and the Window (Form) with that button has 'focus' then pressing Enter will 'click' that button.
no1home2day
2009-09-30 05:33:54 UTC
You select the "KeyPress event" and have it check if the key pressed was the Enter key, then call the event of the button you want it to perform.
?
2016-12-04 18:13:56 UTC
ummm.. permit me remember first.. under no circumstances reallyyy theory on such deep subjects !! nyuk..nyuk... ! i press it difficult ! i recommend it makes a " tick" sound as quickly as I press it !! however i spotted i press the "area" key greater good !!! :P reallyy.. !! nyuk...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...