#272 – Displaying a Border Around a Window

You can include a border around the edges of a Window using the BorderBrush and BorderThickness properties.

By default, the BorderBrush is null and BorderThickness is a Thickness structure with all of its dimensions set to 0.

If you specify only the BorderThickness property, you get a black border around the window.

<Window
	 BorderThickness="5,10,5,10">

You can also specify both a border brush and a border thickness.

<Window
	 BorderThickness="20">

	<Window.BorderBrush>
	 	<LinearGradientBrush>
            <GradientStop Color="DarkKhaki" Offset="0.0"/>
            <GradientStop Color="DarkGreen" Offset="1.0"/>
        </LinearGradientBrush>
	</Window.BorderBrush>

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: