title: Windows 8.1 xaml stretch doesnt shrink button
body: <p>I have a grid that has multiple rows and columns (shown below) and in each cell there is a button, much like a calculator. The buttons have the HorizontalAlignment and VerticalAlignment set to "Stretch" </p>
  
  <p>However, due to different screen sizes and my need to maintain equal sizing of the widths and heights of the cells and controls in them, I have given the widths and the heights as *</p>
  
  <p>I would expect that the buttons therefore fill the cell that they're in, but they don't fit. You can see this is the screenshot from the development environment. The first button shows where the border of the button is...
  They actually bust out of the side, and have a margin at the top and bottom of about 8 pixels.</p>
  
  <p>The text in each button is a single digit so I know the size of the text can't be the issue and wondered if anyone had any ideas? I don't want to have to manually set margins for each button as this is not only time consuming, but if the application runs on a different sized screen, they might fit.</p>
  
  <pre><code>        &lt;Grid Grid.Row="2" x:Name="ButtonsGrid" Margin="18,9,18,0"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="*" /&gt;
              &lt;RowDefinition Height="*" /&gt;
              &lt;RowDefinition Height="*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="*" /&gt;
              &lt;ColumnDefinition Width="*" /&gt;
              &lt;ColumnDefinition Width="*" /&gt;
              &lt;ColumnDefinition Width="*" /&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;Button Grid.Row="0" Grid.Column="0" Content="1"
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="0" Grid.Column="1" Content="2" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="0" Grid.Column="2" Content="3" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="0" Grid.Column="3" Content="4" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
  
          &lt;Button Grid.Row="1" Grid.Column="0" Content="5" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="1" Grid.Column="1" Content="6" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="1" Grid.Column="2" Content="7" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="1" Grid.Column="3" Content="8" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
  
          &lt;Button Grid.Row="2" Grid.Column="0" Content="9" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="2" Grid.Column="1" Content="0" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
          &lt;Button Grid.Row="2" Grid.Column="2" Content="Clear" 
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.ColumnSpan="2" /&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/UepEx.jpg" alt="Screen shot from development environment"></p>