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.

适用于

另请参阅