How to create F1 help in windows forms using c#

后端 未结 1 1043
灰色年华
灰色年华 2020-12-28 20:01

How do you create the keyboard shortcut(F1) in a windows form using c#. WinChm

相关标签:
1条回答
  • 2020-12-28 20:27

    Add an event handler for a control's HelpRequested event and then use the Help.ShowHelp.

    For example,

    private void button1_HelpRequested(object sender, HelpEventArgs hlpevent)
    {
       Help.ShowHelp(this, "helpfile.chm", HelpNavigator.TopicId, "1234");
    }
    

    You can use different HelpNavigator options to show things like the table of contents, etc.

    See this related question for more information.

    0 讨论(0)
提交回复
热议问题