How can I vertically align a Label
and TextBlock
at Top
so that their first lines of text line up?
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Column="0" VerticalAlignment="Top">Some Label:</Label>
<TextBlock Grid.Column="0" VerticalAlignment="Top">Some text<TextBlock>
</Grid>
The above code gives me this:
The extra space around the label comes from the Padding property. To remove the space, you can explicitly set the Padding property to "0" directly on the Label, or, of course, set it via a Style.