SubMenuStyleCollection.Insert(Int32, SubMenuStyle) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定的索引處插入物件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 範圍不在集合範圍內。
指定的 style 為 null。
備註
若索引為 -1,則 style 插入於集合的 SubMenuStyleCollection 開頭。 若索引等於集合中項目數量, style 則會附加在集合末 SubMenuStyleCollection 尾。
OnValidate此方法被呼叫以驗證樣式參數,然後才加入集合。 OnInsert該方法在物件插入SubMenuStyle集合前OnInsertComplete被呼叫,且在物件插入後呼叫。