views:

428

answers:

3

How can I make the top and bottom padding smaller in the following label? As I see it, the bounding box in much bigger than it needs to be, but the padding is set to 0, so it cannot be any smaller.

<Label Background="AliceBlue" Content="1800" FontSize="170" FontWeight="Bold" Foreground="Gray" Padding="0" />
A: 

Have you tried margin?

Anders Rune Jensen
Yes, actually I have set that to 0
Bjarne
A: 

Padding does not exists in XAML on a FrameworkElement. Use Margin.

Padding can be applied to three elements: Block, Border and Control since these elements have an outer edge

Bryan
A: 

You can use Margin.

With margin you can set the amount you want to go left, right, top , bottom

by this i mean

Margin="0,0,0,0" that means. you have none what so ever.

it goes by the following. Margin ="left, top, right, bottom"

so if i have margin ="2,5,3,5"

it means i have a margin 2 pixels in from the left, 5 pixels in from the top, 3 pixels from the right and 5 pixels up from the bottom.

Kevin