ControlCollection.RemoveAt(Int32) 메서드

정의

개체에서 지정된 인덱스 위치에 있는 자식 컨트롤을 ControlCollection 제거합니다.

public:
 virtual void RemoveAt(int index);
public virtual void RemoveAt(int index);
abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unit
Public Overridable Sub RemoveAt (index As Integer)

매개 변수

index
Int32

컬렉션에서 제거할 서버 컨트롤의 서수 인덱스입니다.

예외

읽기 ControlCollection 전용입니다.

예제

다음 코드 예제에서는 이 메서드를 RemoveAt 사용하여 서버 컨트롤에서 자식 컨트롤을 삭제합니다 myButton . 메서드 호출은 먼저 컨트롤이 삭제되는 인덱스 위치 1을 지정합니다. 그런 다음 이 예제에서는 해당 위치의 컨트롤이 컬렉션에서 ControlCollection 삭제되었다는 문자 메시지를 포함하는 페이지에 씁니다.

// Use the RemoveAt method to delete the child control
// at index location 1.           
myButton.Controls.RemoveAt(1);
msgRemoveAt.Text = "The control at index location 1 has been removed.";
' Use the RemoveAt method to delete the child control
' at index location 1.           
myButton.Controls.RemoveAt(1)
msgRemoveAt.Text = "The control at index location 1 has been removed."

설명

해당 값에 따라 컬렉션에서 컨트롤을 제거하려면 메서드를 Remove 사용합니다.

적용 대상

추가 정보