ToolboxItem.OnComponentsCreating(ToolboxComponentsCreatingEventArgs) 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
引發 ComponentsCreating 事件。
protected:
virtual void OnComponentsCreating(System::Drawing::Design::ToolboxComponentsCreatingEventArgs ^ args);
C#
protected virtual void OnComponentsCreating (System.Drawing.Design.ToolboxComponentsCreatingEventArgs args);
abstract member OnComponentsCreating : System.Drawing.Design.ToolboxComponentsCreatingEventArgs -> unit
override this.OnComponentsCreating : System.Drawing.Design.ToolboxComponentsCreatingEventArgs -> unit
Protected Overridable Sub OnComponentsCreating (args As ToolboxComponentsCreatingEventArgs)
OnComponentsCreating 方法會引發 ComponentsCreating 事件。 在叫用工具箱專案以建立元件之後,就會呼叫這個方法,緊接在呼叫 方法之前 CreateComponentsCore 。
引發事件會透過委派叫用此事件處理常式。 如需詳細資訊,請參閱 處理和引發事件。
OnComponentsCreating 方法也允許衍生類別處理事件,而不用附加委派。 這是在衍生類別中處理事件的慣用技巧。
在衍生類別中覆 OnComponentsCreating(ToolboxComponentsCreatingEventArgs) 寫時,請務必呼叫基類的 OnComponentsCreating(ToolboxComponentsCreatingEventArgs) 方法,讓已註冊的委派接收事件。
產品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |