Removing visible border from Dialog with Menu
Howdy. We\ve built a simple UI for an application that incorporates
three CDialogs.
We have a "main" Dialog, which serves as a main window. Two additional
CDialog instances
are used within the "main" Dialog. Both addidional CDialogs reside in
the top of the "main" CDialog; side by side. Inside one of them (one
at the top left corner) we have an instance of CMenu.
This CMenu has the same background (yellow png file) as the CDialog
this CMenu resides in.
What's the problem? The CMenu displays a border line on its bottom; we
do not want to see this line.
Take a look at this URL: <a href="http://www.rosco.vel.pl/img/
menu_sample.jpg">sample</a>
I think this line gives CMenu a bit of 3D appearance. We dont want
such appearance.
Any hints how to get this line removed?
Below is a code we use to create the CMenu inside a CDialog.
CBitmap * bitmap = CBitmap::FromHandle(m_hBitmap);
CBrush* NewBrush;
NewBrush = new CBrush(bitmap);
MENUINFO MenuInfo = {0};
MenuInfo.cbSize = sizeof(MenuInfo);
MenuInfo.hbrBack = *NewBrush; // Brush you want to draw
MenuInfo.fMask = MIM_BACKGROUND;
MenuInfo.dwStyle = MNS_AUTODISMISS | MIM_STYLE;
MenuInfo.cyMax = 25;
m_menu = new CMenu();
m_menu->LoadMenuA(IDR_MENU1);
if(IsMenu(m_menu->m_hMenu)) {
SetMenuInfo(m_menu->m_hMenu, &MenuInfo);
}
this->SetMenu(m_menu); // when commented out, the line and the menu
disappear