如何防止多个HelpProvider窗口? [英] How do I prevent multiple HelpProvider windows?

查看:77
本文介绍了如何防止多个HelpProvider窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Windows窗体项目中使用了HelpProvider,除了用户多次按下F1,然后启动多个帮助窗口实例外,它正在工作。这不是很理想。有没有办法防止多个帮助窗口,如果按下F1,只需将焦点放在一个帮助窗口上?



感谢您的帮助。

I'm using HelpProvider in my Windows Form project, and it's working except for the fact that if the user presses F1 multiple times, then multiple instances of the help window are launched. This is not very desirable. Is there a way to prevent multiple help windows, and simply give focus to the one help window if F1 is pressed?

Thanks for any help.

推荐答案

好的,我发现了问题,虽然我不明白。我正在使用Process.Start();但后来我看到了一个使用Help.ShowHelp()的例子;这是下拉帮助菜单的事件处理程序(不是F1键),所以我不知道它为什么修复了F1键的情况,但确实如此。多重行为消失了。



OK, I found the problem, although I don't understand all. I was using Process.Start(); but then I saw an example using Help.ShowHelp(); This is the event handler for the dropdown help menu (not F1 key), so I don't know why it fixed the F1 key case as well, but it did. The multiple behavior is gone.

private void menuItem6_Click(object sender, System.EventArgs e)
{
    //Process.Start("Flash_Help.chm");
    Help.ShowHelp(this, "Flash_Help.chm");
}


这篇关于如何防止多个HelpProvider窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆