Control.ControlCollection.SetChildIndex(Control, Int32) 方法

定义

将集合中指定子控件的索引设置为指定的索引值。

public:
 void SetChildIndex(System::Windows::Forms::Control ^ child, int newIndex);
public:
 virtual void SetChildIndex(System::Windows::Forms::Control ^ child, int newIndex);
public void SetChildIndex(System.Windows.Forms.Control child, int newIndex);
public virtual void SetChildIndex(System.Windows.Forms.Control child, int newIndex);
member this.SetChildIndex : System.Windows.Forms.Control * int -> unit
abstract member SetChildIndex : System.Windows.Forms.Control * int -> unit
override this.SetChildIndex : System.Windows.Forms.Control * int -> unit
Public Sub SetChildIndex (child As Control, newIndex As Integer)
Public Overridable Sub SetChildIndex (child As Control, newIndex As Integer)

参数

child
Control

要搜索的 child 控件。

newIndex
Int32

控件的新索引值。

例外

注解

调用时SetChildIndexControl参数所引用child的引用将移动到指定newIndex的位置,并且重新排序中Control其他Control.ControlCollection引用以适应移动。 索引值为零的控件位于 z 顺序的顶部,数字越接近底部。

适用于

另请参阅