From the course: Windows Presentation Foundation 5: Interaction and Controls

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

The Border

The Border

- [Instructor] The border class has one purpose, to draw a border around the outside of a child element. Typically, it's used in conjunction with elements that don't have a built in border feature. Let's look at the UI that I have in this border page example file. I have this rectangle, the rectangle does support a border. So, it doesn't make any sense for me to wrap this rectangle with a border. The rectangle has a border but it's not called that. It's called the stroke. So, I can come here and set the stroke. I choose the brush. Then, I choose the stroke thickness. And now, it appears to have a border drawn around the outside edge. There are some elements on this page that don't have borders. The stack panel's one. The stack panel's purpose is to arrange its children. It has no functionality for drawing any borders. So, I will wrap the stack panel with a border. And to do that, I'll use a nice feature of Visual Studio. It's called, surround with. So, I'll select all of the elements…

Contents