Help.ShowHelpIndex 方法

显示指定帮助文件的索引。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Shared Sub ShowHelpIndex ( _
    parent As Control, _
    url As String _
)
用法
Dim parent As Control
Dim url As String

Help.ShowHelpIndex(parent, url)
public static void ShowHelpIndex (
    Control parent,
    string url
)
public:
static void ShowHelpIndex (
    Control^ parent, 
    String^ url
)
public static void ShowHelpIndex (
    Control parent, 
    String url
)
public static function ShowHelpIndex (
    parent : Control, 
    url : String
)

参数

  • parent
    标识“帮助”对话框的父级的 Control
  • url
    帮助文件的路径和名称。

备注

url 参数的形式可以是 C:\path\sample.chm 或 /folder/file.htm。

示例

下面的代码示例显示带有三个按钮的窗体,这些按钮可用于与 mspaint.chm 帮助文件进行交互。“显示帮助索引”按钮显示帮助文件的“索引”选项卡。“显示帮助”按钮根据“帮助导航器”列表中选择的值显示帮助文件的内容。“显示关键字”按钮根据“关键字”文本框中指定的关键字显示帮助文件的内容。

例如,若要按索引值显示 Ovals 帮助页,请在“帮助导航器”下拉列表中选择 HelpNavigator.KeywordIndex 值,在“参数”文本框中键入 ovals,然后单击“显示帮助”按钮。若要按关键字显示“使用画笔绘图”帮助主题,请在“关键字”文本框中键入 mspaint.chm::/paint_brush.htm,然后单击“显示关键字”按钮。

此示例仅演示对 ShowHelpIndex 方法的调用。有关完整的代码示例,请参见 Help 类概述。

Private Sub showIndex_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles showIndex.Click
    ' Display the index for the Help file.
    Help.ShowHelpIndex(Me, helpfile)
End Sub 'showIndex_Click
private void showIndex_Click(object sender, System.EventArgs e)
{
    // Display the index for the help file.
    Help.ShowHelpIndex(this, helpfile);
}
private:
   void showIndex_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      
      // Display the index for the help file.
      Help::ShowHelpIndex( this, helpfile );
   }
private void showIndex_Click(Object sender, System.EventArgs e)
{
    // Display the index for the help file.
    Help.ShowHelpIndex(this, helpfile);
} //showIndex_Click

.NET Framework 安全性

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

Help 类
Help 成员
System.Windows.Forms 命名空间
ShowHelp