tags:

views:

421

answers:

2

Basically, I want to create a window that looks like the following: alt text

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.

+2  A: 

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.

Drew Marsh
Is there a way to intercept windows messages to stop the cursor from being changed when the mouse is over the border?
Daniel
Well, I know you can [hook the Windows message loop][1], so you might want to look into that. Honestly I'm not sure what messages to watch for to be able to intercept interaction with the Window chrome or if you even can for that matter.[1]: http://blogs.msdn.com/nickkramer/archive/2006/03/18/554235.aspx
Drew Marsh
A: 

This should do the trick for you: http://dmullaney.tumblr.com/post/971504547/aero-glass-border-without-resize-in-wpf

Dave Mullaney