Share via


SubMenuStyleCollection.Insert(Int32, SubMenuStyle) 方法

定義

SubMenuStyle 物件插入位於指定之索引的 SubMenuStyleCollection 集合。

public:
 void Insert(int index, System::Web::UI::WebControls::SubMenuStyle ^ style);
public void Insert (int index, System.Web.UI.WebControls.SubMenuStyle style);
member this.Insert : int * System.Web.UI.WebControls.SubMenuStyle -> unit
Public Sub Insert (index As Integer, style As SubMenuStyle)

參數

index
Int32

以零啟始的索引,應在該處插入 SubMenuStyle

style
SubMenuStyle

要插入 SubMenuStyle 集合中的 SubMenuStyleCollection 物件。

例外狀況

指定的 index 超出集合的範圍。

指定的 stylenull

備註

如果 index 是 -1, style 則會插入集合的 SubMenuStyleCollection 開頭。 如果 index 等於集合中的專案數, style 則會附加至集合結尾 SubMenuStyleCollection

系統會 OnValidate 呼叫 方法,先驗證樣式參數,再將它新增至集合。 方法 OnInsert 會在物件插入集合之前 SubMenuStyle 呼叫,並在 OnInsertComplete 插入 物件之後呼叫 方法。

適用於