Question: I create a small application in which, i want when my window(WPF) is maximized it's controls are also resized according to window size.I tried this code-

```
 If Me.WindowState = Windows.WindowState.Maximized Then
        Me.WindowState = Windows.WindowState.Normal
        Me.Width = 820
        Me.Height = 440
        Me.Grid1.Width = 780
        Me.Grid1.Height = 400
        Me.StackPanel1.Height = 360
        Me.StackPanel1.Width = 140
        Me.StackPanel2.Height = 360
        Me.StackPanel2.Width = 600
 Else If Me.WindowState = Windows.WindowState.Normal Then
        Me.WindowState = Windows.WindowState.Maximized
        'Me.Width = 1350
        'Me.Height = 600
        Me.Grid1.Width = 1300
        Me.Grid1.Height = 600
        Me.StackPanel1.Height = 460
        Me.StackPanel1.Width = 200
        Me.StackPanel2.Height = 460
        Me.StackPanel2.Width = 800

```

Answer: 
Why you can't wrap your controls inside Grid? When you set columns width and rows height using \*, it will change columns and rows size whenever window be resized. Also controls should have HorizontalAlignment and VerticalAlignment set to Stretch.
You should use a table-layout panel, and doc your controls inside!