Share via


SubMenuStyleCollection.OnInsert(Int32, Object) 方法

定義

Add(SubMenuStyle)Insert(Int32, SubMenuStyle) 方法之前呼叫。

protected:
 override void OnInsert(int index, System::Object ^ value);
protected override void OnInsert (int index, object value);
override this.OnInsert : int * obj -> unit
Protected Overrides Sub OnInsert (index As Integer, value As Object)

參數

index
Int32

應在 value 插入以零為起始的索引。

value
Object

要插入至 SubMenuStyleCollection 集合的物件。

例外狀況

value 不是 SubMenuStyle 型別。

備註

方法 OnInsert 會在 和 Insert 方法之前 Add 呼叫。 您可以在自訂 SubMenuStyleCollection 類別中覆寫 OnInsert 方法,以在物件新增至 SubMenuStyleCollection 集合之前執行物件的自訂處理 SubMenuStyle

適用於

另請參閱