Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setting shortcut keys for buttons

0 views
Skip to first unread message

John Salerno

unread,
Nov 11, 2005, 11:14:37 PM11/11/05
to
Is there a way to set a single key to activate a button on a form?

La Grasserie

unread,
Nov 12, 2005, 2:02:53 PM11/12/05
to
Hi John,

I use the KeyPress event of the form to select a key.
Snippet:-
private void Form1_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)

{

switch(e.KeyChar.ToString().ToLower())

{

case "b":this.btnBooking.PerformClick();

break;

case "e":this.btnEditbk.PerformClick();

break;

case "u":this.btnUpload.PerformClick();

break;

}

}

Regards,
Grass

"John Salerno" <john...@NOSPAMgmail.com> wrote in message
news:KrSdncBvAtH...@rcn.net...

0 new messages