3

I'm working on a custom window to add more styling to my application.

I followed some tutorials to enable basic window behaviors :

  • Closing
  • Maximizing
  • Minimizing
  • Moving
  • Resizing

These are all okay.

I would like what is I believe a Windows 7 functionnality : When a window is maximized, I can still drag it to another screen, where it will kept its maximized state.

Do you have any Idea how I could do this?

PS : The tutorials I used :

Thanks a lot,

Regards

Antoine Jeanrichard
  • 1,103
  • 1
  • 10
  • 18

2 Answers2

2

If you have a Thumb in your title bar, you can subscribe to the DragDelta event and wait until WindowState == WindowState.Maximized && dragEventArgs.Y > 100 to restore the window.

Daniel Moore
  • 1,116
  • 1
  • 9
  • 16
  • Sorry, a year late, but that's a good idea! I also was trying to create a new Window (Inheriting of the window class, as a UserControl), but I could only create a new template for the window, as Decyclone said. – Antoine Jeanrichard May 01 '12 at 14:16
1

Why would you want to implement something that Windows already does for you?

That feature is Windows 7 specific and even if you create a custom template for your window, windows will take care of it. Now, I guess all you would have to do is call DragMove() from a thumb by which you enable moving of window.

decyclone
  • 30,394
  • 6
  • 63
  • 80
  • Hello Decyclone, that's what I've done, but it doesn't gives you the Windows 7 maximizing behavior, nor the one that gives a window half the screen width (when dragging it to the left or right side of the screen). – Antoine Jeanrichard Feb 29 '12 at 14:49