How to change the backcolor of MainMenu

G

Guest

Is it possible to change the backcolor of a MainMenu
I have tried using the handle property of the inherited Menu class using it as a parameter for the win32 api function SetMenuInfo, but it didn't work

Any help

Thx in advance, Marc
 
D

DotNetJunkies User

You can change it with this code. Do not forget to add MIM_BACKGROUND to fMask. It works.

HBRUSH hBrush;
MENUINFO mi = { 0 };

//Office XP menu bar background color
hBrush = CreateSolidBrush(RGB(195,218,249));

mi.cbSize = sizeof(MENUINFO);
mi.fMask = MIM_BACKGROUND|MIM_APPLYTOSUBMENUS;
mi.hbrBack = hBrush;
SetMenuInfo(hMenu, &mi);

Atila
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top