简体   繁体   中英

CMenu border color on MFC

I've a class that inherit from CMenu Owner draw menu

using this class the Menu appears correctly but, for example, when you open the menu FILE you will see the border and the separator of the standard menu color

How I can paint also this part of the desired color?

below an image, you can see the submenu of files with selected colors (green) and the standard windows menu gray on the borders/spacers

在此处输入图片说明

Using the menu example this is possible with these lines of code inside "AddSubMenus" function

MENUINFO MenuInfo = { 0 };
MenuInfo.cbSize = sizeof(MENUINFO);
GetMenuInfo(&MenuInfo);
MenuInfo.hbrBack = ::CreateSolidBrush(RGB(0, 0, 0));
MenuInfo.fMask = MIM_BACKGROUND | MIM_STYLE;
MenuInfo.dwStyle = MIM_APPLYTOSUBMENUS;
SetMenuInfo(&MenuInfo);
tmpmenu.SetMenuInfo(&MenuInfo);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM