Freigeben über


Package.CreateToolWindow Method

Creates a tool window of the specified type with the specified ID.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

'Declaration
Protected Function CreateToolWindow ( _
    toolWindowType As Type, _
    id As Integer _
) As ToolWindowPane
'Usage
Dim toolWindowType As Type
Dim id As Integer
Dim returnValue As ToolWindowPane

returnValue = Me.CreateToolWindow(toolWindowType, _
    id)
protected ToolWindowPane CreateToolWindow(
    Type toolWindowType,
    int id
)
protected:
ToolWindowPane^ CreateToolWindow(
    Type^ toolWindowType, 
    int id
)
member CreateToolWindow : 
        toolWindowType:Type * 
        id:int -> ToolWindowPane 
protected function CreateToolWindow(
    toolWindowType : Type, 
    id : int
) : ToolWindowPane

Parameters

  • toolWindowType
    Type: System.Type
    The type of tool window to create.
  • id
    Type: System.Int32
    The tool window ID. This is 0 for a single-instance tool window.

Return Value

Type: Microsoft.VisualStudio.Shell.ToolWindowPane
An instance of the requested tool window.

Exceptions

Exception Condition
ArgumentNullException

toolWindowType is null.

ArgumentException
  • id is less than 0.

  • toolWindowType is not derived from ToolWindowPane type.

Remarks

The CreateToolWindow method creates an instance of the given tool window. This is used within the Package base class when implementing the Visual Studio interface tool window creation code as well as the FindToolWindow method.

.NET Framework Security

See Also

Reference

Package Class

Package Members

Microsoft.VisualStudio.Shell Namespace