Click here to Skip to main content
15,879,239 members
Articles / Desktop Programming / WPF

Resizing a Custom WPF Window

Rate me:
Please Sign up or sign in to vote.
4.63/5 (8 votes)
4 Jun 2010CPOL4 min read 63.8K   2.4K   23  
Learn how to enable resizing of a custom WPF window created in Expression Blend
<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="MainWindow"
	x:Name="Window"
	Title="MainWindow"
	Width="400" Height="300" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}" MinWidth="200" MinHeight="100" WindowStartupLocation="CenterScreen">

	<Grid x:Name="LayoutRoot">
		<Rectangle Fill="#FFF4F4F5" Stroke="Black" RadiusY="15.5" RadiusX="15.5" StrokeThickness="2"/>
		<Thumb x:Name="TopThumb" Height="6" Margin="14,0" VerticalAlignment="Top" Cursor="SizeNS" DragDelta="Top_DragDelta" Opacity="0"/>
		<Thumb x:Name="BtmThumb" Height="6" Margin="14,0" VerticalAlignment="Bottom" Cursor="SizeNS" DragDelta="Btm_DragDelta" Opacity="0"/>
		<Thumb x:Name="RgtThumb" HorizontalAlignment="Right" Margin="0,14" Width="6" Cursor="SizeWE" DragDelta="Rgt_DragDelta" Opacity="0"/>
		<Thumb x:Name="LftThumb" HorizontalAlignment="Left" Margin="0,14" Width="6" Cursor="SizeWE" DragDelta="Lft_DragDelta" Opacity="0"/>
	</Grid>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Kenya Kenya
Experienced C# software developer with a passion for WPF.

Awards,
  • CodeProject MVP 2013
  • CodeProject MVP 2012
  • CodeProject MVP 2021

Comments and Discussions