WPF StackPanel controls order

stackpanelwpf

Is there a way to change the order of the controls inside a StackPanel at runtime?

Many thanks,
Paulo

Best Answer

stackPanel1.Children.Remove(item);
stackPanel1.Children.Insert(newIndex, item);