Accelerator keys in VB.NET 
Author Message
 Accelerator keys in VB.NET

What is the best way to handle accelerator keys in .NET?  Is there some
automatic setting to enable and catch this, or do we have to write code
(i.e. in the OnKeyDown sub for the form)?  Basically, if they hit an
accelerator key (such as Ctrl-A) on the form I want it to 'press' the Clear
button I have defined on the form.

Thanks.

Tom



Tue, 01 Nov 2005 23:42:10 GMT  
 Accelerator keys in VB.NET
Hello,


Quote:
> What is the best way to handle accelerator keys in .NET?  Is there some
> automatic setting to enable and catch this, or do we have to write code
> (i.e. in the OnKeyDown sub for the form)?  Basically, if they hit an
> accelerator key (such as Ctrl-A) on the form I want it to 'press' the
Clear
> button I have defined on the form.

Define a hidden menu and select the accelerator in the items' Shortcut
property. Then you can add the code into the click event handler of the menu
item.

Regards,
Herfried K. Wagner



Wed, 02 Nov 2005 00:03:22 GMT  
 Accelerator keys in VB.NET
One way is to put a & in front of the letter in the Text property.
e.g. for a button labeled Start if you write
&Start then the S will be underlined and will appear when you press the Alt
key.
--
Joe Fallon


Quote:
> What is the best way to handle accelerator keys in .NET?  Is there some
> automatic setting to enable and catch this, or do we have to write code
> (i.e. in the OnKeyDown sub for the form)?  Basically, if they hit an
> accelerator key (such as Ctrl-A) on the form I want it to 'press' the
Clear
> button I have defined on the form.

> Thanks.

> Tom



Wed, 02 Nov 2005 02:03:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Accelerator keys in vb

2. Word 2000, CommandBars and Accelerator Keys.

3. Accelerator Key Display in Custom Menu

4. Accelerator key problem

5. Accelerator key takes 2 tries to open combobox

6. UserForm, CommandButton, Accelerator Key

7. User Forms, Command Buttons, Accelerator Keys

8. Accelerator keys won't display on form load

9. Accelerator keys on toolbar?

10. Accelerator Keys not recognized

11. Accelerator Keys in SSTab control

12. Accelerator Keys in VBS?

 

 
Powered by phpBB® Forum Software