change the children index of stackpanel in wpf [closed]

前提是你 提交于 2021-02-19 03:23:08

问题


I want to know how I can change the children index of a StackPanel in c# code.

For example, I want to make the child that is currently second to be displayed first. I need animation when changing the index.

I am using a StackPanel because I need the Orientation property to stack all elements and keep them grouped together. If you have better idea to use another control, I am open to that.


回答1:


StackPanel.Children is a UIElementCollection that easily allows to reorder elements by e.g. its Insert and RemoveAt methods.



来源:https://stackoverflow.com/questions/10488738/change-the-children-index-of-stackpanel-in-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!