Control.ControlCollection.GetChildIndex 메서드

정의

컨트롤 컬렉션 내에 있는 컨트롤의 인덱스를 가져옵니다.

오버로드

GetChildIndex(Control)

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 인덱스를 가져옵니다.

GetChildIndex(Control, Boolean)

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 인덱스를 가져옵니다. 지정된 컨트롤이 컨트롤 컬렉션 내에 없으면 예외가 발생할 수도 있습니다.

GetChildIndex(Control)

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 인덱스를 가져옵니다.

public:
 int GetChildIndex(System::Windows::Forms::Control ^ child);
public int GetChildIndex (System.Windows.Forms.Control child);
member this.GetChildIndex : System.Windows.Forms.Control -> int
Public Function GetChildIndex (child As Control) As Integer

매개 변수

child
Control

컨트롤 컬렉션에서 검색할 Control입니다.

반환

Int32

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 위치를 나타내는 0부터 시작하는 인덱스 값입니다.

예외

child 컨트롤이 Control.ControlCollection에 없는 경우

설명

인덱스 값이 0인 컨트롤은 z 순서의 맨 위에 있으며 더 높은 숫자는 아래쪽에 가깝습니다.

추가 정보

적용 대상

GetChildIndex(Control, Boolean)

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 인덱스를 가져옵니다. 지정된 컨트롤이 컨트롤 컬렉션 내에 없으면 예외가 발생할 수도 있습니다.

public:
 int GetChildIndex(System::Windows::Forms::Control ^ child, bool throwException);
public:
 virtual int GetChildIndex(System::Windows::Forms::Control ^ child, bool throwException);
public int GetChildIndex (System.Windows.Forms.Control child, bool throwException);
public virtual int GetChildIndex (System.Windows.Forms.Control child, bool throwException);
member this.GetChildIndex : System.Windows.Forms.Control * bool -> int
abstract member GetChildIndex : System.Windows.Forms.Control * bool -> int
override this.GetChildIndex : System.Windows.Forms.Control * bool -> int
Public Function GetChildIndex (child As Control, throwException As Boolean) As Integer
Public Overridable Function GetChildIndex (child As Control, throwException As Boolean) As Integer

매개 변수

child
Control

컨트롤 컬렉션에서 검색할 Control입니다.

throwException
Boolean

child 매개 변수에 지정된 ControlControl.ControlCollection에 있는 컨트롤이 아닌 경우 예외를 throw하려면 true이고, 그렇지 않으면 false입니다.

반환

Int32

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 위치를 나타내는 0부터 시작하는 인덱스 값입니다. Control에 지정된 Control.ControlCollection이 없으면 -1을 반환합니다.

예외

childControlControl.ControlCollection에 없고, throwException 매개 변수 값이 true입니다.

설명

인덱스 값이 0인 컨트롤은 z 순서의 맨 위에 있으며 더 높은 숫자는 아래쪽에 가깝습니다. -1의 반환 값은 매개 변수가 throwException 있는 경우에만 반환됩니다 false.

추가 정보

적용 대상