使用 HelpKeyword 和 TopicID 的选项卡页控件上的 HelpProvider 和上下文相关帮助

发布于 2025-01-07 23:23:53 字数 465 浏览 0 评论 0原文

我遇到了谷歌搜索未能解决的问题(或者也许我没有输入关键字的神奇组合)。无论如何,我遇到了以下问题:

我正在使用 VS 提供的 HelpProvider 组件为我的应用程序创建上下文相关帮助。为了创建我的帮助文件,我使用 HelpSmith,它生成具有主题和相应主题 ID 的 .chm 文件。这个想法是,一旦设置了 HelpProvider.HelpNamespace,我就可以从控件属性中编辑 HelpKeyword 和 HelpNavigator 选项。当我指定按钮的 HelpKeyword = 20 且 HelpNavigator = TopicID 时,这似乎有效。我运行,单击并按住按钮,然后按 F1,我的帮助文件将按预期在正确的主题上打开。不过,我对每个 TabPage 控件的上下文相关帮助更感兴趣。当我单击外部 TabControl 但不单击各个选项卡页时,它似乎起作用。理想情况下,我想单击标签所在的选项卡并以这种方式显示帮助。

这可能吗?

谢谢!

I have run into an issue that Google search has failed to solve (or maybe I didn't punch in the magical combination of keywords). Anyway I am having the following problem:

I am creating context sensitive help for my application using the HelpProvider component provided by VS. To create my help files I am using HelpSmith which produces .chm files that have topic and corresponding topic IDs. The idea is that once the HelpProvider.HelpNamespace has been set, I can edit the HelpKeyword and HelpNavigator options from the control properties. This seems to work when I specify that a button's HelpKeyword = 20 and the HelpNavigator = TopicID. I run, click and hold the button and press F1 and my help file opens on the right topic as expected. However I am more interested in context-sensitive help per TabPage control. It seems to work when I click the outer TabControl but not the individual tab pages. Ideally I would like to click the tab where the label is and display help in that way.

Is this possible?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

捂风挽笑 2025-01-14 23:23:53

我刚刚遇到这个问题,似乎焦点必须在选项卡页面内(而不是选项卡本身)。可能有比这更好的解决方案,但这可行。当选定的选项卡索引更改时,它将焦点移动到选项卡内的第一个控件。

    /// <summary>
    /// Moves the focus to the first control on the tab to ensure that the context sensitive help works
    /// </summary>
    private void tabcMaster_SelectedIndexChanged(object sender, EventArgs e)
    {
        SelectNextControl(tabcMaster.SelectedTab,true,true, true, false);
    }

I was just having this problem, it seems that the focus has to be inside the tab page (rather than the tab itself). There may be a nicer solution than this, but this works. It moves the focus to the first control inside the tab when the selected tab index is changed.

    /// <summary>
    /// Moves the focus to the first control on the tab to ensure that the context sensitive help works
    /// </summary>
    private void tabcMaster_SelectedIndexChanged(object sender, EventArgs e)
    {
        SelectNextControl(tabcMaster.SelectedTab,true,true, true, false);
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文