Help2.DisplayTopicFromF1Keyword Method (String)
Displays Help for F1 and from dialog boxes.
Namespace: Microsoft.VisualStudio.VSHelp80
Assembly: Microsoft.VisualStudio.VSHelp80 (in Microsoft.VisualStudio.VSHelp80.dll)
Syntax
'Déclaration
Sub DisplayTopicFromF1Keyword ( _
pszKeyword As String _
)
void DisplayTopicFromF1Keyword(
string pszKeyword
)
void DisplayTopicFromF1Keyword(
[InAttribute] String^ pszKeyword
)
abstract DisplayTopicFromF1Keyword :
pszKeyword:string -> unit
function DisplayTopicFromF1Keyword(
pszKeyword : String
)
Parameters
- pszKeyword
Type: System.String
String containing the F1 keyword to display the associated topicc..
Implements
Help.DisplayTopicFromF1Keyword(String)
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;
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 Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.