共用方式為


Help2.HowDoI Method

Shows the How Do I window.

Namespace:  Microsoft.VisualStudio.VSHelp80
Assembly:  Microsoft.VisualStudio.VSHelp80 (in Microsoft.VisualStudio.VSHelp80.dll)

Syntax

'宣告
Sub HowDoI
void HowDoI()
void HowDoI()
abstract HowDoI : unit -> unit 
function HowDoI()

Examples

Create a Visual Studio add-in by using Visual C# as described in How to: Create an Add-In. Add references to Microsoft.VisualStudio.VSHelp, Microsoft.VisualStudio.VSHelp80, and System.Windows.Forms. Replace the code in the OnConnection method in the Connect.cs file with the following code. Run the code example as described in How to: Compile and Run the Automation Object Model Code Examples.

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;
    HelpShowHowDoIxample(_applicationObject);
}

public void HelpShowHowDoIxample(DTE2 dte)
{
    // Sets focus on the How Do I window.
    try
    {
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject
("Help2");

        // Set focus on How Do I window.
        help2.HowDoI();

    }
    catch (SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}

.NET Framework Security

See Also

Reference

Help2 Interface

Microsoft.VisualStudio.VSHelp80 Namespace