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 메서드.

적용 대상

추가 정보