UIElementCollection.RemoveAt(Int32) 메서드

정의

지정된 인덱스에서 UIElement를 제거합니다.

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

제거할 UIElement의 인덱스입니다.

구현

예제

다음 예제에서는 RemoveAt 메서드는 지정 된 인덱스 위치에 있는 자식 콘텐츠를 제거 합니다.

void RemoveButton(object sender, MouseButtonEventArgs e)
{
    if ((sp1.Children.IndexOf(btn) >= 0) || (sp1.Children.IndexOf(btn1) >= 0) || (sp1.Children.IndexOf(btn2) >= 0) || (sp1.Children.IndexOf(btn3) >= 0))
    {
        sp1.Children.RemoveAt(0);
    }
}

적용 대상