function keys for Short cut

G

Guest

Hi,

I want to use function keys as shortcuts to buttons in my
appplication(vb.net). E.g. by pressing F3 strat button should get clicked.
How can I do this?


Waiting for early response,
--RbanBph
 
H

Herfried K. Wagner [MVP]

RbanBph said:
I want to use function keys as shortcuts to buttons in my
appplication(vb.net). E.g. by pressing F3 strat button should get clicked.
How can I do this?

Place a mainmenu component to your form, add some items and assign the
function keys as shortcuts. Then you can add the code to the menuitems'
'Click' event handlers.
 
H

Herfried K. Wagner [MVP]

RbanBph said:
Can it be done using sendKeys? If yes then how should I go about it?

Why do you want to use 'SendKeys'? What exactly do you want to archieve?
 
G

Guest

Hi,
I have four buttons on my form. I want to assign F1 to F4 short
cut keys to these buttons. I have set keypreview property of the form as
true. I want the respective button to be clicked whenever i press any of
these short cut keys appropriate to the button.

-RbanBph
 
H

Herfried K. Wagner [MVP]

RbanBph said:
I have four buttons on my form. I want to assign F1 to F4 short
cut keys to these buttons. I have set keypreview property of the form as
true. I want the respective button to be clicked whenever i press any of
these short cut keys appropriate to the button.

Call the button's 'PerformClick' method to raise its 'Click' event if the
button is enabled and visible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top