Border on three sides

WpfBorder

Wpf Problem Overview


Is there way to create a border that is only on the top, left, and right sides?

Wpf Solutions


Solution 1 - Wpf

Yes:

<Border BorderThickness="1 1 1 0" BorderBrush="Black"/>

Same as goes for Margin, Padding etc.

Solution 2 - Wpf

And just for fun, to do so in code:

var b = new Border(); 
b.BorderThickness = new Thickness{Top=1, Bottom=0, Left=1, Right=1}; 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJonathan AllenView Question on Stackoverflow
Solution 1 - WpfGoblinView Answer on Stackoverflow
Solution 2 - WpfBrady MoritzView Answer on Stackoverflow