我如何在不按F1的情况下调用helpprovider? [英] How can i invoke helpprovider without pressing F1?
本文介绍了我如何在不按F1的情况下调用helpprovider?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应该在C#项目(Win Form)中不按F1键的情况下调用helpprovider.例如;当我按"h"键时,帮助文件将打开.我该怎么做?
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?
推荐答案
假设这是您要显示的chm文件,则应使用System.Windows.Forms.Help
因此,请听一个按键,并显示您的chm文件:
Assuming it is a chm-file you want to show, you should useSystem.Windows.Forms.Help
So listen to a key stroke, and show your chm-file:
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#
这篇关于我如何在不按F1的情况下调用helpprovider?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文