By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

how to capture AltH key

P: n/a
How can I capture the key press AltH in a button control.

--
Ron Vecchi

Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Handle the KeyDown/KeyUp event.

-vJ

"Ron Vecchi" <rv*****@xilehdvecchi.com> wrote in message
news:O3**************@TK2MSFTNGP11.phx.gbl...
How can I capture the key press AltH in a button control.

--
Ron Vecchi

Nov 15 '05 #2

P: n/a

Hi Ron,

You should handle the button's keydown event, like this:
private void button1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if((e.KeyCode==Keys.H)&&(e.Alt==true))
{
MessageBox.Show("Alt+H");
}
}

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.