WPF - Change the place of a control in a grid in code-behind

依然范特西╮ 提交于 2019-12-12 18:34:59

问题


Is it possible to change where a control is placed in a grid from code-behind?

For example, if I have a Button in Grid.Row="1", can I change that to Grid.Row="0" from code-behind?


回答1:


Yes. Just go:

Grid.SetRow(button,0);

where button is the element to change.



来源:https://stackoverflow.com/questions/3785572/wpf-change-the-place-of-a-control-in-a-grid-in-code-behind

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