1

I'm trying to create a MainMenu for my application that looks similar to the one used by Mozilla Firefox:

So that it displays over aero glass. I can think of a few ways to do this, except they would be ugly, and probably ruin the experience of the program due to them being hackish.

I'm wondering if there is a way to custom draw the MainMenu control, similar to how you can override the OnPaint method on other controls (which for some reason, MainMenu doesn't have). Or if that is not possible, what sort of hacky ways could I use that wouldn't ruin the UX.

Yes, I'm sure there is a ridiculously easy way to do this in WPF, and I would love to be able to take the time to learn it, but my application is already in a semi-mature stage, and it would be extremely inconvenient to switch to a different UI platform at this point.

Community
  • 1
  • 1
nobody
  • 85
  • 5
  • http://windowsformsaero.codeplex.com/ – Robert Harvey Jun 15 '12 at 22:26
  • Thanks for replying. The first link redirects to my own list of articles (of which I have none), and I am aware of the project at the second link, but I don't see how it helps me with my question. Perhaps I should read its documentation again? – nobody Jun 15 '12 at 22:32
  • Wow, that was weird... http://www.codeproject.com/Articles/15394/Drawing-smooth-text-and-pictures-on-the-extended-g – Robert Harvey Jun 15 '12 at 22:33
  • Even so, as far as I can tell, neither of those projects mentions anything about menus. – nobody Jun 15 '12 at 22:47
  • 1
    IMHO Firefox's attempts at incorporating glass into their UI are more attempts than actual well-done solutions. You might rather want to take a look at Paint.NET in that regard. – Joey Jun 15 '12 at 22:54

1 Answers1

1

I ended up creating my own control that inherits ToolStripMenuItem and overriding OnPaint and drawing the text with DrawThemeTextEx, and using a modified version of the MenuStrip renderer found here that omits the rendering of header text (so it doesn't conflict with DrawThemeTextEx and the background bar of the ToolStrip.

Final product looks like this:

:)

nobody
  • 85
  • 5