title: WPF Textbox and Label are overlapping
body: <p>I am learning WPF (Windows Presentation Foundation) on Visual Studio 2013. I have an issue with the layout of elements. I am using <em>stackpanel</em> and <em>grid</em> for element layout. Here is the simple layout which i have created:</p>
  
  <pre><code>... code omitted....
  
      &lt;StackPanel Style="{StaticResource ersStackPanel}"&gt;
          &lt;Grid Style="{StaticResource ersGrid}"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="497*"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Label Content="Elector's record scrapper" Style="{StaticResource ersHeadLabel}" /&gt;
          &lt;/Grid&gt;
          &lt;Grid Style="{StaticResource ersGrid}"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="150*"/&gt;
                  &lt;ColumnDefinition Width="347*"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Label Content="VS" Style="{StaticResource ersLabel}"/&gt;
              &lt;TextBox x:Name="VS" Grid.Column="1" Style="{StaticResource ersTextBox}" /&gt;
              &lt;Label Content="EV" Grid.Row="1" Style="{StaticResource ersLabel}"/&gt;
              &lt;TextBox x:Name="EV" Grid.Row="1" Grid.Column="1" Style="{StaticResource ersTextBox}" /&gt;
              &lt;Label Content="ENo." Grid.Row="2" Style="{StaticResource ersLabel}"/&gt;
              &lt;TextBox x:Name="ENo" Grid.Row="2" Grid.Column="1" Style="{StaticResource ersTextBox}" /&gt;
              &lt;Label Content="Select" Grid.Row="3" Style="{StaticResource ersLabel}"/&gt;
              &lt;ComboBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" FontFamily="Verdana" FontSize="10" Background="White"/&gt;
          &lt;/Grid&gt;
      &lt;/StackPanel&gt;
  
  ... code omitted...
  </code></pre>
  
  <p><strong>Style Resource</strong></p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;Style x:Key="ersTextBox" BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}"&gt;
          &lt;Setter Property="FontSize" Value="10"&gt;&lt;/Setter&gt;
          &lt;Setter Property="FontFamily" Value="Verdana"&gt;&lt;/Setter&gt;
          &lt;Setter Property="FontWeight" Value="Medium"&gt;&lt;/Setter&gt;
          &lt;Setter Property="Width" Value="250"&gt;&lt;/Setter&gt;
          &lt;Setter Property="HorizontalAlignment" Value="Left"&gt;&lt;/Setter&gt;
          &lt;Setter Property="VerticalAlignment" Value="Top"&gt;&lt;/Setter&gt;
          &lt;Setter Property="Height" Value="23"&gt;&lt;/Setter&gt;
          &lt;Setter Property="TextWrapping" Value="Wrap"&gt;&lt;/Setter&gt;
      &lt;/Style&gt;
      &lt;Style x:Key="ersLabel" BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}"&gt;
          &lt;Setter Property="FontFamily" Value="Verdana"&gt;&lt;/Setter&gt;
          &lt;Setter Property="FontSize" Value="10"&gt;&lt;/Setter&gt;
          &lt;Setter Property="FontWeight" Value="Bold"&gt;&lt;/Setter&gt;
          &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"&gt;&lt;/Setter&gt;
          &lt;Setter Property="HorizontalAlignment" Value="Right"&gt;&lt;/Setter&gt;
          &lt;Setter Property="VerticalAlignment" Value="Top"&gt;&lt;/Setter&gt;
          &lt;Setter Property="Width" Value="auto"&gt;&lt;/Setter&gt;
      &lt;/Style&gt;
      &lt;Style x:Key="ersHeadLabel" BasedOn="{StaticResource ResourceKey=ersLabel}" TargetType="{x:Type Label}"&gt;
          &lt;Setter Property="FontSize" Value="20"&gt;&lt;/Setter&gt;
          &lt;Setter Property="HorizontalAlignment" Value="Center"&gt;&lt;/Setter&gt;
      &lt;/Style&gt;
      &lt;Style x:Key="ersStackPanel" TargetType="{x:Type StackPanel}"&gt;
          &lt;Setter Property="Width" Value="497"&gt;&lt;/Setter&gt;
          &lt;Setter Property="Height" Value="44"&gt;&lt;/Setter&gt;
          &lt;Setter Property="VerticalAlignment" Value="Top"&gt;&lt;/Setter&gt;
          &lt;Setter Property="HorizontalAlignment" Value="Center"&gt;&lt;/Setter&gt;
          &lt;Setter Property="Margin" Value="0,10,0,0"&gt;&lt;/Setter&gt;
      &lt;/Style&gt;
      &lt;Style x:Key="ersGrid" TargetType="{x:Type Grid}"&gt;
          &lt;Setter Property="Height" Value="44"&gt;&lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>The problem is that all elements (Label, TextBox ..) are overlapping each other, Why they are not positioning like a stack (one after another) ??</p>