views:

50

answers:

2

If I have a menu bar in WPF and I set its Border to be black and have thickness 1, I get a crsip 1 pixel border all the way around the menu bar, instead of just a nice crisp line at the bottom. Similarly for a status bar. How can I get a nice crisp boundary around just part of a WPF element like a menu bar or status bar?

Having crisp 1 pixel border around parts of element boundaries is so common there must be some standard ways of doing this. What are they?

+3  A: 

Not not 100% sure I understand your question, but what I think your're looking for is a border that is visible just on the bottom of an element. You can accomplish this with the BorderThickness property:

BorderThickness="0,0,0,1"

That will set the left, top and right borders to 0 and the bottom to 1. If you set ...

BorderThickness="1"

that is the same as ...

BorderThickness="1,1,1,1"
John Myczek
+1  A: 

Do you mean a Border? If so...

<Border Name="myBorder" BorderBrush="Black" BorderThickness="0,0,2,2">
 <!-- your stuff here -->
</Border>
Alex