Control.InitLayout 方法

定義

在控制項加入其他容器後呼叫。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.

適用於

另請參閱