Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 2.22 KB

border.md

File metadata and controls

53 lines (34 loc) · 2.22 KB
-api-id -api-type
T:Windows.UI.Xaml.Controls.Border
winrt class

Windows.UI.Xaml.Controls.Border

-description

Draws a border, background, or both, around another object.

-xaml-syntax

<Border>
  singleChild
</Border>

-remarks

Border is a container control that draws a border, background, or both, around another object. Here's a gray border around two rectangles.

A border around 2 rectangles

You can specify basic properties of a Border by setting its Width, Height, BorderBrush, BorderThickness, and Background color. In addition, you can round the border corners by setting the CornerRadius property, and you can position the object inside the Border by setting the Padding property.

A Border can contain only one child object. If you want to put a border around multiple objects, wrap them in a container object such as StackPanel.

Version history

Windows version SDK version Value added
1809 17763 BackgroundSizing
1809 17763 BackgroundTransition

-examples

[!div class="nextstepaction"] Open the WinUI 2 Gallery app and see the Border in action

The WinUI 2 Gallery app includes interactive examples of most WinUI 2 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub.

[!code-xamlBasicBorderXAML]

[!code-xamlLayoutOvwBorder]

-see-also

FrameworkElement, Alignment, margin, and padding