Panel.Children Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém um UIElementCollection conjunto de elementos filhos disto Panel.
public:
property System::Windows::Controls::UIElementCollection ^ Children { System::Windows::Controls::UIElementCollection ^ get(); };
public System.Windows.Controls.UIElementCollection Children { get; }
member this.Children : System.Windows.Controls.UIElementCollection
Public ReadOnly Property Children As UIElementCollection
Valor de Propriedade
Um UIElementCollection. O padrão é um vazio UIElementCollection.
Exemplos
O exemplo de código seguinte demonstra como usar a Children propriedade para adicionar um UIElement filho a um Panel elemento.
StackPanel myStackPanel = new StackPanel();
Button myButton = new Button();
myButton.Content = "Press me";
myStackPanel.Children.Add(myButton);
Dim myStackPanel As New StackPanel()
Dim myButton As New Button()
myButton.Content = "Press me"
myStackPanel.Children.Add(myButton)
Observações
A Children coleção de um Panel elemento só pode consistir em UIElement objetos. Adicionar um UIElement filho a um Panel implícitamente adiciona-o ao UIElementCollection para o Panel elemento.
Não use esta coleção com classes derivadas Panel ; use a InternalChildren coleção em vez disso.
Esta propriedade retorna null se o Panel for limitado pelos dados.