title: How can I remove the margins around text in a WPF label?
body: <p>I am trying to make a little virtual keyboard out of labels. The following is my keyboard in XAML (but with more than just 3 keys):</p>
  
  <pre><code>&lt;StackPanel Orientation="Vertical"&gt;
      &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center"&gt;
          &lt;Border BorderThickness="1" BorderBrush="DarkGray"&gt;
              &lt;Label Content="A" FontSize="12" MouseDown="KeyButton_Click" /&gt;
          &lt;/Border&gt;
          &lt;Border BorderThickness="1" BorderBrush="DarkGray"&gt;
              &lt;Label Content="B" FontSize="12" MouseDown="KeyButton_Click" /&gt;
          &lt;/Border&gt;
      &lt;/StackPanel&gt;
      &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center"&gt;
          &lt;Border BorderThickness="1" BorderBrush="DarkGray"&gt;
              &lt;Label Content="C" FontSize="12" MouseDown="KeyButton_Click" /&gt;
          &lt;/Border&gt;
      &lt;/StackPanel&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>The problem with this is that there is too much space surrounding the text in the labels, causing the keyboard to be much bigger than it needs to be. If I manually set the height and width of the labels, that will (1) not account for differences in fonts and (2) will cut of part of the letter rather than the top and left margins. Is there any other way to shrink these margins to be just about the same size as the text itself?</p>