wpf 拉伸窗体只改变控件位置不改变控件大小怎么做?
1个回答
展开全部
--大小不改变,位置改变(相对右下)
<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="183,131,0,0" Name="button1" Click="button1_Click" HorizontalAlignment="Left" Width="234" Height="45" VerticalAlignment="Top" />
</Grid>
--大小不改变,位置改变(相对左上)
<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="0,0,223,304" Name="button1" Click="button1_Click" HorizontalAlignment="Right" Width="234" Height="45" VerticalAlignment="Bottom" />
</Grid>
--大小改变,位置不改变(相对左上)
<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="183,131,223,304" Name="button1" Click="button1_Click" />
</Grid>
主要调整 Margin ,在blend里调整直观一些
<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="183,131,0,0" Name="button1" Click="button1_Click" HorizontalAlignment="Left" Width="234" Height="45" VerticalAlignment="Top" />
</Grid>
--大小不改变,位置改变(相对左上)
<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="0,0,223,304" Name="button1" Click="button1_Click" HorizontalAlignment="Right" Width="234" Height="45" VerticalAlignment="Bottom" />
</Grid>
--大小改变,位置不改变(相对左上)
<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="183,131,223,304" Name="button1" Click="button1_Click" />
</Grid>
主要调整 Margin ,在blend里调整直观一些
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询