WPF WindowChrome Title Bar Menu

by Avatar Bill Henning (Actipro) - 4 comments
Friday, February 21, 2020 at 2:27pm

Actipro WPF Controls v2020.1 development is in progress, and the new version’s main goals are to modernize our UI control features/themes, and make theme customization much easier.

In the previous post, we saw how WindowChrome supported placing a user profile popup button in a Window title bar.  In today’s post, we’ll add a full Menu control to the title bar instead.

Title Bar Menus

The 2020.1 version makes it easy to add custom title bar content when using WindowChrome.  In fact, you can customize the left, center, or right portions of the title bar however you like.

Let’s put a Menu control into the left side of the title bar.

Menu in the window title bar

For this kind of menu, we’ve created special subclass of the native Menu that has some minor adjustments so that the menu looks great in the title bar.

If you wish to use all capitals for the menu items like Visual Studio does, that's a simple change to the Header property of each menu item.

Summary

With the new features coming to WindowChrome, it’s easy to maximize window real estate by placing menus in the title bar.  Many modern apps are using this technique today.

Post in the comments below if you have any feedback or questions about WindowChrome title bar customization.

Actipro's WPF Controls

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Learn More

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Includes editors, docking windows, MDI, property grids, charts, tree controls, ribbons, gauges, themes, and much more.

Learn More Download Free Trial

Comments (4)

Posted 2 months ago by Dirk Zellerfeld
Avatar

Will it be possible to have custom close/minimize buttons? And have controls which are placed on the "title bar" but also part of the main window? I'm speaking about making the title bar looking a lot less like a titlebar.

Also how does the WindowChrome reacts on window dragging then? Can we expand it so the window can be dragged by clicking anywhere?

Do you have plans for Windows 10 fluent / glass look?

Posted 2 months ago by Bill Henning (Actipro) - Actipro Software LLC
Avatar

Hi Dirk,

We don't have any plans for custom close/minimize buttons.  What were you specifically looking to change there?

As for putting content area controls in the title bar, yes that is another feature that we will show in one of the next blog posts.

There is an attached property where you can designate how various elements should be treated (i.e. non-client area, title bar area, etc.).  We will update our sample for our feature to show off how to do that as well.

We haven't looked into acrylic just yet, but that is something on our list to investigate.

Posted 2 months ago by Dirk Zellerfeld
Avatar

I'm looking for changing the look of the close/minimize buttons. Especially now that we can merge the title bar (thanks for that!) it would be great if we can fit those standard buttons to our own design (changing size, color on mouse hover, adding background with round corners making them more plastic or even move them to the left of the window).

Posted 2 months ago by Bill Henning (Actipro) - Actipro Software LLC
Avatar

Hi Dirk,

We have special Styles for the WindowChrome title bar buttons (even in the 2019.1 version) that you can override the Template for if you wish.  Such as a ButtonBase-oriented Style with x:Key="{x:Static themes:SharedResourceKeys.WindowTitleBarButtonBaseStyleKey}".

Add Comment

Please log in to a validated account to post comments.