autohotkey macro run with command button

Posted by D-Bar under Visual Studio on 9/7/2012 | Points: 10 | Views : 2044 | Status : [Member] | Replies : 1
Hello All, Thanks for reading my first post. My question is: In VS2010 I have a command button on my web app, when I click on the button I want it to act like it is entering keystrokes (Ctrl+o). Is there any way to do this, and if so, how?
Thank-you very much


Posted by: Vasanthmvp on: 9/7/2012 [Member] Starter | Points: 25

You want to assign a short cut key (hotkey) to your button. If this is your question then,

-- An access key (also known as a hot key) allows users to press the ALT key plus another key to navigate to a specific web server control on the page.
-- Some ALT+Keys are reserved just like Alt+F opens the file tab, Atl+D takes us to address bar, etc. It depends on the browser to give preference over the reserved keys and hot keys.
--Hot keys are not supported by all the browsers. (IE supports this.)
-- You can assign access key to a label, text box, button etc. using the ACCESKEY property.

Here is an example for you:

<asp:Button id="btn" runat="server" AccessKey="Y" Text="Click" Onclick="Method" />


Protected void Method(object Sender, EventArgs e)


Awesome Coding !! :)

D-Bar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response