作者tocute (小飘)
看板C_Sharp
标题[问题] [wpf]user control 等比例缩放
时间Tue Jun 29 18:11:22 2010
不好意思问个简单问题
我现在做个user control
希望他在使用时 能随着视窗大小作等比例的缩放
我现在是把所有东西都放在 viewbox 内
这样 control 是可以等比例缩放 但是他的位子会跑
请问有没有一劳永逸的方法呢??
谢谢
code 如下
<UserControl x:Class="UsefulUI.UsefulUIPlus"
xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
Width="auto" Height="auto">
<Viewbox Stretch="Uniform" >
<Grid>
<Border Width="320" Height="320"></Border>
<Button Width="22" Height="22">X</Button>
<ContentPresenter Margin="20,20" Width="300" Height="300"/>
</Grid>
</Viewbox>
</UserControl>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.128.79.49