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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。