Immutable windows with a window

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

However, the window should not be changed (in the screenshot), but should 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 similar to the one in my screenshot, but not changeable? Any help would be greatly appreciated.

+7
c # wpf window
source share
2 answers

One way to make a window with a fixed size while maintaining the border is to set the values ​​Min [Width | Height] and Max [Width | Height] for the same value. A resize cursor will be displayed on the border, but the user will not be able to resize the window.

If the fact that the border still indicates that it is resizing bothers you, the next step is to set ResizeMode = "NoResize", but then you should start drawing your own Aero glass if you want to keep the edges of the glass.

+17
source share

You can probably get the desired result: ResizeMode =
A property of an XAML object that it can accept has the following states:

  • NoResize - cannot resize the window. The Minimize and Maximize buttons do not appear in the title bar.
  • CanMinimize - the window can only be minimized and restored. The Minimize and Maximize buttons are displayed, but only the Minimize button is enabled.
  • CanResize - you can resize the window. The Minimize and Maximize buttons are shown and enabled.
  • CanResizeWithGrip - you can resize the window. The Minimize and Maximize buttons are shown and enabled. A resize handle appears in the lower right corner of the window.
+17
source share

All Articles