This is in C# in WPF:
I know I can add items to a stack panel like so: myStackPanel.Children.Add(new Button());
Or to a ListBox like so: myListBox.Items.Add(new Button());
Of course, I could edit beforehand the controls and add them latter, like set the proprieties first then add them.
But how do I select the control once it is in the stack layout with code behind. For example, is there a way similar to this: myStackPanel.Childern.CONTROL_AT_INDEX[n]
? And then how can I edit it even more like change the content of a label if it is a label or the event handler if it is a button ?
Also I want a solution for the ListBox as well please. I just don't know how to access those controls once they are inside.