Wednesday 15 June 2011

c# - Is it possible to change parent of WPF control -


Is it possible to change the guardian of WPF control? Here's an example:

StackPanel in Stack 1 has the button btn1. Another empty stackpanel is stack2. I want to move BTN 1 programmatically to Stack 2.

Thanks for the help.

You can do this via property:

  stack 1. Children Remove (BTN1); Stack2.Children.Add (btn1);    

No comments:

Post a Comment