Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically pressing F1 key on keyboard

Status
Not open for further replies.

kyledunn

Programmer
Jan 2, 2001
145
US
Anyone know the code to make a program press the F1 key without touching the keyboard? In other words when I click a button I want the computer to respond as if I had pressed the F1 key. Any help would be appreciated.

Kyle
 
I was going to suggest you look in System.Win32, but I don't see a way to call the API call PostMessage() there....

Chip H.
 
This can be accomplished with

SendKeys.Send({F1});

Someone on another forum gave me the answer. It's really great to have so many people sharing their knowledge. Thanks for your thoughts.

Kyle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top