代码之家  ›  专栏  ›  技术社区  ›  Tavousi

将帮助文件连接到应用程序

c#
  •  3
  • Tavousi  · 技术社区  · 14 年前

    我该怎么做? 谢谢。

    4 回复  |  直到 14 年前
        1
  •  5
  •   Mazhar Karimi Mazhar Karimi    14 年前

    试试这个

    string fbPath = Application.StartupPath;
    string fname = "help.chm";
    string filename = fbPath + @"\" + fname;
    FileInfo fi = new FileInfo(filename);
    if (fi.Exists)
    {
    Help.ShowHelp(this, filename, HelpNavigator.Find, "");
    }
    else
    {
    MessageBox.Show("Help file Is in Progress.. ",MessageBoxButtons.OK, MessageBoxIcon.Information);
    
    }
    
        2
  •  3
  •   Iain Ward    14 年前

    Help.ShowHelp 在按下按钮等情况下进行操作的方法:

    private void button1_click(object sender, EventArgs e)
    {
          string helpfile = "C:\MyHelp.chm";
          Help.ShowHelp(this, helpfile, mypage.htm);
    }
    

    要通过F1键链接帮助,请参阅本指南以获取有关如何执行此操作的详细说明:

    http://www.dotnetspark.com/kb/162-open-help-file-on-f1-function-key-press.aspx

        3
  •  2
  •   Community CDub    8 年前

    Help.ShowHelp .

    MSDN页面中的一个示例:

    private void Button1_Click(System.Object sender, System.EventArgs e)
        {
    
            Help.ShowHelp(TextBox1, "file://c:\\charmap.chm");
        }
    

        4
  •  1
  •   Ohad Schneider    14 年前

    对于Winforms来说 Windows Forms Programming 提供了一个非常好的概述(第3章,实现帮助)。一些指针: