WPF UI页面等比例放大

WPF UI页面等比例放大


在界面设计时,采用 Canvas,通过绝对定位来设计控件,而不是用Margin

<Grid>
        <DockPanel LastChildFill="True">
            <Menu DockPanel.Dock="Top" VerticalAlignment="Top" />

            <Viewbox Stretch="Fill" >
                <Canvas HorizontalAlignment="Left" Height="442" VerticalAlignment="Top" Width="794" Background="GhostWhite">
                    <Label Content="Button" Canvas.Left="161" Canvas.Top="117" Width="65"/>
                </Canvas>
            </Viewbox>
            <StatusBar DockPanel.Dock="Bottom" Height="20" VerticalAlignment="Botton"/>

        </DockPanel>
    </Grid>
上一篇:wpf窗口区域截图


下一篇:WPF学习记录之MVVM(一)数据绑定