Help.ShowHelpIndex(Control, String) 方法

定義

顯示指定說明檔的索引。

public:
 static void ShowHelpIndex(System::Windows::Forms::Control ^ parent, System::String ^ url);
public static void ShowHelpIndex (System.Windows.Forms.Control parent, string url);
static member ShowHelpIndex : System.Windows.Forms.Control * string -> unit
Public Shared Sub ShowHelpIndex (parent As Control, url As String)

參數

parent
Control

識別 [說明] 對話方塊父代的 Control

url
String

說明檔的路徑和名稱。

範例

下列程式碼範例會顯示一個表單,其中包含三個按鈕,可用來與 mspaint.chm 說明檔互動。 [ 顯示說明索引 ] 按鈕會顯示說明檔的 [索引] 索引 標籤。 [ 顯示說明 ] 按鈕會根據 [說明導覽 ] 清單中選取的值,在 [說明] 檔案中顯示內容。 [ 顯示關鍵字 ] 按鈕會根據 [ 關鍵字 ] 文字方塊中指定的關鍵字,在 [說明檔] 中顯示內容。

例如,若要依索引值顯示橢圓形說明頁面,請在 [說明導覽器] 下拉式清單中選取 HelpNavigator.KeywordIndex 值,在 [參數] 文字方塊中輸入 橢圓 形,然後按一下 [顯示說明] 按鈕。 若要依關鍵字顯示「若要以筆刷繪製」說明主題,請在 [關鍵字] 文字方塊中輸入 mspaint.chm::/paint_brush.htm,然後按一下 [顯示關鍵字] 按鈕。

這個範例只會顯示對 方法的 ShowHelpIndex 呼叫。 如需完整的程式碼範例, Help 請參閱 類別概觀。

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 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

備註

參數 url 的格式可以是 C:\path\sample.chm 或 /folder/file.htm。

適用於

另請參閱