开发者

Modify the main screen so that all controls resize Proportionally when the form is resized

开发者 https://www.devze.com 2022-12-12 05:59 出处:网络
I开发者_运维技巧 need help in acomplishing this in wpf : \"Modify the main screen so that all controls resize Proportionally when the form is resized\"

I开发者_运维技巧 need help in acomplishing this in wpf :

"Modify the main screen so that all controls resize Proportionally when the form is resized"

Thanks

Marius


Question is really vague and not specific.

In WPF there are many ways to do this. The content resize is all about WPF/XAML vector UI. You can put a Grid as the content to the Window and that Grid will resize according to the Window size. So layout your controls accordingly in the Grid and you will get resize as you wish.


One way to accomplish this is to use a UniformGrid panel


Use Grid as the content to Window and put everything inside that, and don't put Height and Width with your controls use HorizontalAlignment, VerticalAlignment, Margin, Padding instead.

For your Grid also give ColumDefinition's Width and RowDefinition's Height in proportion, not in exact term e.g. instead of saying

<ColumnDefinition Width="100"/>

say like this

<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消