語言

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

控制的新索引值。

例外狀況

備註

當 SetChildIndex 被調用時, Control 參數所指 child 的會被移動到指定 newIndex 的位置,其他 Control 參考 Control.ControlCollection 則重新排序以配合移動。 指標為零的控制點位於 z 階的頂端,較高的數字則較接近底部。

適用於

另請參閱