共用方式為


ToolWindow.OnToolWindowCreate 方法

接聽框架中的變更文件視窗

命名空間:  Microsoft.VisualStudio.Modeling.Shell
組件:  Microsoft.VisualStudio.Modeling.Sdk.Shell.11.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Shell.11.0.dll 中)

語法

'宣告
Protected Overridable Sub OnToolWindowCreate
protected virtual void OnToolWindowCreate()

備註

這個方法會從呼叫OnCreate方法建立工具視窗時。

如果偵測到框架的變更,以及框架係授與所監視的文件視窗,會通知在衍生的類別。

範例

下列範例會建立顯示為這是自訂工具視窗工具視窗。

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 安全性

請參閱

參考

ToolWindow 類別

Microsoft.VisualStudio.Modeling.Shell 命名空間