自动将内容大小调整为窗口大小

时间:2019-08-09 15:35:57

标签: c# wpf xaml autoresize

我希望当我更改窗口大小时,仅在调整自身大小时,其中的内容才是默认大小的地方

<Window =Height="500"
Width="800"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
    <TextBlock 
         HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
        Name="consoleOutput" 
        Margin="170,10,10,140" 

        Background="Aqua"/>
    <TextBlock 
         HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
        Name="menuOutput" 
        Margin="10,10,630,245" 
        Background="Gray"/>
    <TextBlock 
         HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
        Name="menuOutput2" 
        Margin="10,245,630,10" 
        Background="Green"/>
    <TextBox 
         HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
        Name="consoleInput" 
        Margin="170,340,10,10"  
        Background="Red"
        AcceptsReturn="True"/>
</Grid>
</Window>

0 个答案:

没有答案
相关问题