Click here to Skip to main content
15,442,081 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I should invoke helpprovider without pressing F1 key in my C# project(Win Form). For example; help file will open when i press 'h' key. How can i do this?
Posted

1 solution

Assuming it is a chm-file you want to show, you should use System.Windows.Forms.Help

So listen to a key stroke, and show your chm-file:
C#
void textBox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.H)
        Help.ShowHelp(this, "my.chm");
}


If you wanted to listen for a key stroke globally, than look at this: Processing Global Mouse and Keyboard Hooks in C#
 
Share this answer
 
Comments
Amund Gjersøe 3-Aug-12 8:50am    
Feel free to comment when voting 1 for no apparent reason.
Y.Desros 4-Aug-12 5:48am    
Good answer +5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900