#271 – Changing a Window’s Resize Behavior
April 9, 2011 Leave a comment
There are four different options for allowing a window to be resized. You set the resizing behavior using the ResizeMode property.
The default value for ResizeMode is CanResize. This results in the standard window border, allowing resizing by dragging the edge of the window.
<Window Width="300" Height="150" ResizeMode="CanResize">
The CanResizeWithGrip option is similar to CanResize, but the lower right corner of the window shows a little “grip” icon indicating that you can “grab” the window here to resize it.
<Window Width="300" Height="150" ResizeMode="CanResizeWithGrip">
The NoResize option creates a window that can’t be resized, minimized or maximized. Notice that the minimize and maximize buttons have also disappeared.
<Window Width="300" Height="150" ResizeMode="NoResize">
The final choice for ResizeMode is CanMinimize, which creates a window that can’t be resized or maximized, but can be minimized.
<Window Width="300" Height="150" ResizeMode="CanMinimize">