Alex Rivera | Logout

Non-resizable windows with windowStyle=None

Asked 2009-10-15T03:14:33.093
16

Basically, I want to create a window that looks like the following: alt text http://www.thex9.net/screenshots/2009-10-15_1347.png

However, the window shouldn't be resizable (the one in the screenshot is) but must retain the glass border. The XAML for the window in the screenshot is as follows:

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="WpfApplication1.MainWindow"
    x:Name="Window" Title="MainWindow" WindowStyle="None">    
 <Grid x:Name="LayoutRoot"/>
</Window>

Is it possible to create a window which looks similar to the one in my screenshot but is not resizable? Any help would be very much appreciated.

Edit
Report

1 Answer

22

One way to accomplish a fixed size Window while retaining the border is to set the Min[Width|Height] and Max[Width|Height] properties to be the same value. The border will still show the resize cursor, but the user will not be able to change the size of the Window.

If the fact that the border still indicates that it's resizable bothers you, the next step is to set the ResizeMode="NoResize", but then you have to start drawing your own Aero glass if you want to retain the glass edges.

answered 2009-10-15T05:04:48.643

Your Answer