0

I want that when i change the window size, that my content in it will be places as in the default size only should it resize itself

<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>
Chloe
  • 1
  • 2
    Don't use Margins for layout. Use the Grid's Rows and Columns. – Clemens Aug 09 '19 at 15:36
  • 1
    You may also want to read about the different Panel classes: [Panels Overview](https://learn.microsoft.com/en-us/dotnet/framework/wpf/controls/panels-overview). And about [Layout](https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/layout) in general. – Clemens Aug 09 '19 at 15:40

0 Answers0