WPF Web Based

WPF Examples

WPF

WPF Projects

WPF Project

adplus-dvertising
Rectangle Control in WPF Web Base
Previous Home Next

Rectangle Means

From Latin: rectus right + angle

A 4-sided polygon where all interior angles are 90°

The rectangle, like the square, is one of the most commonly known quadrilaterals. It is defined as having all four interior angles 90° (right angles). The Rectangle object represents a rectangle shape and draws a rectangle with the given height and width. The <Rectangle/> element of XAML draws a rectangle. The Height and Width attributes represent the height and width of the rectangle. The Stroke and StrokeThickness represents the color and thickness of the rectangle boundary.

Example:

.XAML CODE

<Page x:Class="WpfBrowserApplication6.Page2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page2">
<Grid>
<Rectangle Margin="14,40,0,0" Name="rectangle1" 
Stroke="Violet" StrokeThickness="9" Height="100" 
VerticalAlignment="Top" HorizontalAlignment="Left"
Width="200" Fill="Pink" RadiusX="6" RadiusY="6" />
</Grid>
</Page>

In this code The Fill attributes fill a rectangle with a color. The following code fills a rectangle with pink color.

By setting RadiusX and RadiusY attributes, you can also draw a rectangle with rounded corders.

Output:
Previous Home Next
WPF Examples

WPF

WPF

WPF

WPF

WPF

WPF

WPF

WPF