If I create a toolbar with a label and a button like this:
<ToolBar Height="26" >
<Label>Hi mom</Label>
<Button>Press me</Button>
</ToolBar>
The button text centers on the toolbar and does not get clipped.
How can I make the text on the label appear with an equal apperanc开发者_StackOverflow中文版e as the button?
Update
Here's how to do it with a Label (fixed Left/Right padding)
<ToolBar Height="26" >
<Label Padding="5,0,5,0" VerticalAlignment="Center">Hi mom</Label>
<Button>Press me</Button>
</ToolBar>
Ok, I figured out the TextBlock version:
This creates a textblock which creates a similar apperance as the button:
<TextBlock Margin="2 2 3 0" VerticalAlignment="Center" Text="Press Me"></TextBlock>
精彩评论