The Border Control
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:
<Border BorderBrush="Red" BorderThickness="3" CornerRadius="8"> <Rectangle Height="100"/></Border>
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 as the Grid
or StackPanel
. Figure 29.1 shows the result of the preceding code.
Specifying Different Brushes ...
Get Visual Basic 2015 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.