Dinesh Subramanian
asked on
adding a stackpanel control to expander programmatically in WPF
hi,
How to add a stackpanel control to expander control programmatically
Here is the code
How to add a stackpanel control to expander control programmatically
Here is the code
private void button1_Click(object sender, RoutedEventArgs e)
{
Expander exp1 = new Expander();
StackPanel sp1 = new StackPanel();
Button newBtn = new Button();
newBtn.Content = "A New Button";
sp1.Children.Add(newBtn);
// Here I want to add the sp1 (StackPanel) to the exp1 (Expander)
wrapPanel1.Children.Add(exp1);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.