WPF Web Based

WPF Examples

WPF

WPF Projects

WPF Project

adplus-dvertising
Border Control In WPF Web Base
Previous Home Next

The controls in WPF do not have border property so WPF provides a border control. Similar to other WPF elements, the Border has Width, Height, Background, and Horizontal Alignment and Vertical Alignment properties.

properties of Border:

  • BorderThickness: The BorderThickness property represents the thickness of the border.
  • BorderBrush: The BorderBrush property represents the brush that is used to draw the border.

The Corner Radius property represents the degree to which the corners of a Border are rounded.

Code for Border:

<Page x:Class="WpfBrowserApplication2.Page2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page2">
<Grid Background="Aquamarine">
<Border BorderThickness="5" BorderBrush="Green"
        CornerRadius="10" Background="LightGray"
		HorizontalAlignment="Left" VerticalAlignment="Top"
		Width="270" Height="250"><Canvas Background="LightPink" >
<Rectangle Canvas.Left="30" Canvas.Top="20" Height="200"
        Width="200" Stroke="Black" StrokeThickness="10" Fill="Red" />
</Canvas>
</Border>
</Grid>
</Page>
Output:
Previous Home Next
WPF Examples

WPF

WPF

WPF

WPF

WPF

WPF

WPF

WPF