Share via


UIElementCollection.RemoveAt(Int32) Método

Definición

Quita el elemento UIElement en el índice especificado.

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)

Parámetros

index
Int32

Índice del objeto UIElement que desea quitar.

Implementaciones

Ejemplos

En el ejemplo siguiente se usa el RemoveAt método para quitar contenido secundario en una posición de índice especificada.

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);
    }
}

Se aplica a