共用方式為


ToolWindow.OnToolWindowCreate Method

Listens for frame changes in a document window

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0.dll)

Syntax

'宣告
Protected Overridable Sub OnToolWindowCreate
protected virtual void OnToolWindowCreate()
protected:
virtual void OnToolWindowCreate()
abstract OnToolWindowCreate : unit -> unit 
override OnToolWindowCreate : unit -> unit 
protected function OnToolWindowCreate()

Remarks

This method is called from the OnCreate method when the tool window is created.

Derived classes are notified if a frame change is detected and the frame is assigned to the document window that is being monitored.

Examples

The following example creates the label that reads This is the custom tool window for the tool window.

protected override void OnToolWindowCreate()
{
     this.myLabel = new Label();
     this.myLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.myLabel.Text = "This is the custom tool window";
}

.NET Framework Security

See Also

Reference

ToolWindow Class

Microsoft.VisualStudio.Modeling.Shell Namespace