0

How do I make the StackPanel have a Bottom Border and a thickness of 1?

I've tried it a few ways, one of them is below but nothing I've tried works (including some of the answers I found on SO):

    <Border BorderBrush="#FF1986D1" BorderThickness="1" VerticalAlignment="Bottom">
        <StackPanel Background="#FFC6E1EE" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="13">


        </StackPanel>            
    </Border>
uSeRnAmEhAhAhAhAhA
  • 2,527
  • 6
  • 39
  • 64
  • Seen it and didn't work. And if you even read that question, you'd see that I made a comment on the answer with code stating that the piece of code that makes it "work" doesn't exist so that answer is completely useless. The accepted answer is exactly the same and does not work for the same reason. – uSeRnAmEhAhAhAhAhA Oct 06 '13 at 07:29
  • 1
    I know they are not exactly the same question, but your question can be easily derived from the question it self: ** wrap the stackpanel with border element ** oh, you even figured out yourself. it's weird that they accepted useless answers. – zinking Oct 06 '13 at 07:33
  • @zinking Yeah I was a little disappointed when I finally found that answer and tried it and it didn't work. I don't know why it would work for them and I dunno. Just glad I got it sorted now. Thanks for the link anyway :) – uSeRnAmEhAhAhAhAhA Oct 06 '13 at 07:46

1 Answers1

9

I figured it out:

<Window x:Class=".MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="" Height="558" Width="328">
    <Grid>
        <Border BorderBrush="#FF1986D1" BorderThickness="0 0 0 1" VerticalAlignment="Top">
            <StackPanel Background="#FFC6E1EE" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="113">

            </StackPanel>            
        </Border>
    </Grid>
</Window>
uSeRnAmEhAhAhAhAhA
  • 2,527
  • 6
  • 39
  • 64
  • 1
    http://social.msdn.microsoft.com/Forums/silverlight/en-US/da9b809f-8f4b-4e74-ac8e-afe54030a242/how-to-set-a-border-around-a-stackpanel?forum=silverlightstart this is related MSDN link – zinking Oct 06 '13 at 07:24