Hello, all!
I need a menu with pictures (bitmaps) instead of usual text in menu's items.
I did it this way:
Also it is nessary to set the text in the menu items to " " otherwise there will be only separators instead of pics.
What I get is a menu with pics, BUT these pics are cut to the size of usual menu pics!! AND there is some place to the right of each pic as if there should be some text.
Any ideas??!!
I need a menu with pictures (bitmaps) instead of usual text in menu's items.
I did it this way:
Code:
CBitmap b1, b2;
b1.LoadBitmap(IDB_BITMAP1);
b2.LoadBitmap(IDB_BITMAP3);
CMenu menu;
menu.LoadMenu(IDR_STMENU);
menu.SetMenuItemBitmaps(IDC_BEZ1, MF_BYCOMMAND, &b1, &b1);
menu.SetMenuItemBitmaps(IDC_BEZ2, MF_BYCOMMAND, &b2, &b2);
CPoint pt;
GetCursorPos((LPPOINT)&pt);
menu.GetSubMenu(2)->TrackPopupMenu(TPM_CENTERALIGN, pt.x, pt.y, &m_Grid);
menu.DestroyMenu();
b1.DeleteObject();
b2.DeleteObject();
What I get is a menu with pics, BUT these pics are cut to the size of usual menu pics!! AND there is some place to the right of each pic as if there should be some text.
Any ideas??!!