What is the best way to stop a user from resizing the top-level window of an application written in WPF?

StackOverflow https://stackoverflow.com/questions/278304

  •  07-07-2019
  •  | 
  •  

Question

What is the best way to stop a user from resizing the top-level window of an application written in WPF?

Was it helpful?

Solution

You will want to use the ResizeMode.NoResize on the window.

<Window x:Class="WpfApplication5.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    ResizeMode="NoResize">
</Window>

OTHER TIPS

A WPF quirk to note is that if ResizeMode="NoResize" and WindowStyle="None" you will lose the chrome around the entirely in Vista Aero.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top