[問題] [wpf]user control 等比例縮放

看板C_Sharp作者 (小飄)時間15年前 (2010/06/29 18:11), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
不好意思問個簡單問題 我現在做個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
文章代碼(AID): #1CASRD_p (C_Sharp)