共用方式為


Help2.DisplayTopicFromF1Keyword 方法

顯示的 f1 鍵,並從對話方塊的說明。

命名空間:  Microsoft.VisualStudio.VSHelp80
組件:  Microsoft.VisualStudio.VSHelp80 (在 Microsoft.VisualStudio.VSHelp80.dll 中)

語法

'宣告
Sub DisplayTopicFromF1Keyword ( _
    pszKeyword As String _
)
void DisplayTopicFromF1Keyword(
    string pszKeyword
)
void DisplayTopicFromF1Keyword(
    [InAttribute] String^ pszKeyword
)
abstract DisplayTopicFromF1Keyword : 
        pszKeyword:string -> unit
function DisplayTopicFromF1Keyword(
    pszKeyword : String
)

參數

  • pszKeyword
    類型:String

    字串,其中包含 F1 關鍵字,來顯示相關聯的 topicc。.

範例

建立Visual Studio嵌入式管理單元使用Visual C#中所述如何:建立增益集。 Add references to Microsoft.VisualStudio.VSHelp, Microsoft.VisualStudio.VSHelp80, and System.Windows.Forms. 在程式碼取代OnConnection Connect.cs 檔,下列程式碼中的方法。 執行程式碼範例中所述如何:編譯和執行 Automation 物件模型程式碼範例

using System;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.VSHelp;
using Microsoft.VisualStudio.VSHelp80;
using System.Windows.Forms;

public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    HelpDisplayFromF1Example(_applicationObject);
}

public void HelpDisplayFromF1Example(DTE2 dte)
    {
    // This opens Document Explorer and 
    // displays the topic specified
    // by the F1 keyword.
    try
    {
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject 
("Help2");

        // Display the Owner Attribute topic.
        help2.Contents();
        help2.DisplayTopicFromF1Keyword("Owner");
    }
    catch (SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}

.NET Framework 安全性

請參閱

參考

Help2 介面

Microsoft.VisualStudio.VSHelp80 命名空間