Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show a menu on top of the window's title bar

Tags:

c#

wpf

I was trying for some time now to show a menu like this one on my WPF title bar (the orange one in the upper left corner):

https://wiki.mozilla.org/Firefox/4.0_Windows_Theme%20_Mockups#Large_Button_Mode

I've extended the aero glass into the client area by using the DwmExtendFrameIntoClientArea method. The application icon in the upper left is not visible, and I can show the menu, but one cannot click on it, it doesn't open, and if I put for example a textbox in the title bar, I can't edit its content. I think that my controls are not on top of the title bar. How can I draw them on top of the title bar, so that the menu is clickable?

like image 901
Ehssan Doust Avatar asked Jun 28 '10 10:06

Ehssan Doust


1 Answers

The WPF Shell Integration library might help you to get this working:

http://code.msdn.microsoft.com/WPFShell (via http://blogs.msdn.com/b/llobo/archive/2010/05/10/wpf-shell-integration-library.aspx)

"The custom chrome feature allows applications control over the outer frame of the window so that WPF content can be drawn over the title bar. This allows applications to integrate with Aero glass to emulate the Office 2007/2010 look and feel, or to completely replace the frame with its own content without having to manage all the system behaviors that get lost when using WindowStyle.None"

like image 81
Patrick Klug Avatar answered Nov 12 '22 12:11

Patrick Klug