Border

Consider the Border control as a special container that draws a border around the child control, with the specified color, thickness, and corner radius. The following XAML code draws a red border with a depth of 3 around a rectangle:

image

Changes are immediately visible in the Visual Studio designer. Notice that the Border can nest just one child element, so if you want to add multiple visual elements, you need to encapsulate them within a container such the Grid or StackPanel. Figure 32.1 shows the result of the preceding code.

Figure 32.1 Drawing a border.

Specifying Different Brushes

In the preceding code the BorderBrush is assigned with ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.