title: WPF - Change the Button Size and Position at Runtime - Adjust to the Window
body: <p>My issue is, that I want to adjust the button size and also the position to the size of my window in WPF. I got the event:</p>
  
  <pre><code>private void Window_SizeChanged_1(object sender, SizeChangedEventArgs e)
  {
     if (e.PreviousSize.Height &gt; e.NewSize.Height )
     {
        newGameButton.Height--;
  
     }
     else if (e.PreviousSize.Height &lt; e.NewSize.Height )
    {
        newGameButton.Height++;
    }
  
    if (e.PreviousSize.Width &gt; e.NewSize.Width)
    {
        newGameButton.Width--;
    }
    else if (e.PreviousSize.Width &lt; e.NewSize.Width)
    {
        newGameButton.Width++;
    }
  
  }
  </code></pre>
  
  <p>Is there a posibility to set some points where the button is fixed at and grows and shrinks, depending on the windowsize?</p>