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

控制項的新索引值。

例外狀況

child 控制項不在 Control.ControlCollection 中。

備註

呼叫 時 SetChildIndexControl 參數所參考 child 的 會移至 所 newIndex 指定的位置,並重新排列 中的 Control.ControlCollection 其他 Control 參考,以容納移動。 索引值為零的控制項位於迭置順序的頂端,而較高的數位較接近底部。

適用於

另請參閱