Share via


UIElementCollection.Item[Int32] Propriedade

Definição

Obtém ou define o UIElement armazenado no índice baseado em zero da UIElementCollection.

public:
 virtual property System::Windows::UIElement ^ default[int] { System::Windows::UIElement ^ get(int index); void set(int index, System::Windows::UIElement ^ value); };
public virtual System.Windows.UIElement this[int index] { get; set; }
member this.Item(int) : System.Windows.UIElement with get, set
Default Public Overridable Property Item(index As Integer) As UIElement

Parâmetros

index
Int32

A posição de índice do UIElement.

Valor da propriedade

UIElement

A UIElement na posição especificada index .

Exemplos

O exemplo a seguir usa a Item[] propriedade para identificar o elemento filho em uma posição de índice especificada.

void GetItem(object sender, RoutedEventArgs e)
{
    TextBlock txt2 = new TextBlock();
    sp1.Children.Add(txt2);
    txt2.Text = "UIElement at Index position [0] is " + sp1.Children[0].ToString();
}

Aplica-se a