ListView.OnLayoutCreated(EventArgs) 方法

定義

引發 LayoutCreated 事件。

protected:
 virtual void OnLayoutCreated(EventArgs ^ e);
protected virtual void OnLayoutCreated (EventArgs e);
abstract member OnLayoutCreated : EventArgs -> unit
override this.OnLayoutCreated : EventArgs -> unit
Protected Overridable Sub OnLayoutCreated (e As EventArgs)

參數

e
EventArgs

事件資料。

備註

ListView在可以轉譯控制項之前, ListViewItem 必須先建立 物件,才能做為控制項的容器。 在 LayoutCreated 控制項中 ListView 建立版面配置範本時,就會引發 事件。 這可讓您在發生此事件時執行自訂常式,例如變更範本內 LayoutTemplate 控制項的可見度。

引發事件會透過委派叫用此事件處理常式。 如需詳細資訊,請參閱 處理和引發事件

方法 OnLayoutCreated 也可讓衍生類別處理事件,而不附加委派。 這是在衍生類別中處理事件的慣用技巧。

給繼承者的注意事項

當您在衍生類別中覆寫 OnLayoutCreated(EventArgs) 時,請呼叫基類 OnLayoutCreated(EventArgs) 的 方法,讓已註冊的委派接收事件。

適用於

另請參閱