Control.InitLayout Control.InitLayout Control.InitLayout Control.InitLayout Method

定義

在控制項加入其他容器後呼叫。Called after the control has been added to another container.

protected:
 virtual void InitLayout();
protected virtual void InitLayout ();
abstract member InitLayout : unit -> unit
override this.InitLayout : unit -> unit
Protected Overridable Sub InitLayout ()

備註

InitLayout將控制項新增至容器之後,立即呼叫方法。The InitLayout method is called immediately after adding a control to a container. InitLayout方法可讓控制項以初始化它根據其容器的配置狀態。The InitLayout method enables a control to initialize its layout state based on its container. 例如,您則通常適用錨定和停駐在控制項InitLayout方法。For example, you would typically apply anchoring and docking to the control in the InitLayout method.

給繼承者的注意事項

當覆寫InitLayout()衍生類別時,請務必呼叫基底類別的InitLayout()方法,以便正確地顯示控制項。When overriding InitLayout() in a derived class, be sure to call the base class's InitLayout() method so that the control is displayed correctly.

適用於

另請參閱