How can I place an icon in an menu
-
Hi, I want to add an icon left of the menutext in my menues. For example I have an icon in my toolbox and an equal text entry in my menu. So it would be nice if there is text and additionaly the icon of my toolbox in the menu. Unfortunately I have no idea how to place an icon in a menu. If anybody can help me, write an answer please. SuperRon
-
Hi, I want to add an icon left of the menutext in my menues. For example I have an icon in my toolbox and an equal text entry in my menu. So it would be nice if there is text and additionaly the icon of my toolbox in the menu. Unfortunately I have no idea how to place an icon in a menu. If anybody can help me, write an answer please. SuperRon
-
change the menu items style to owner draw style,then draw it yourself. Check out the BCMenu code for detail. I am seeking... For what? Why did you ask me for what? I don't know!
Ok, but how can I change the menu items style? And how can I connect the icon with the menu item then? Where do can I find the BCMenu code? Please, help me again :omg:
-
Ok, but how can I change the menu items style? And how can I connect the icon with the menu item then? Where do can I find the BCMenu code? Please, help me again :omg:
Get the menu handle or CMenu object(before the menu popup),use ModifyMenu to assign every menu item MF_OWNERDRAW style. And then your windows will be receive WM_MEASUREITEM and WM_DRAWITEM message,in the message handler you measure your menu item size and draw it as your wish. If you use MFC,it would be more easy. MFC will call your CMenu::MeasureItem and CMenu::DrawItem() automatically. BTW: you can find BCMenu in CP. I am seeking... For what? Why did you ask me for what? I don't know!
-
Get the menu handle or CMenu object(before the menu popup),use ModifyMenu to assign every menu item MF_OWNERDRAW style. And then your windows will be receive WM_MEASUREITEM and WM_DRAWITEM message,in the message handler you measure your menu item size and draw it as your wish. If you use MFC,it would be more easy. MFC will call your CMenu::MeasureItem and CMenu::DrawItem() automatically. BTW: you can find BCMenu in CP. I am seeking... For what? Why did you ask me for what? I don't know!
Thanks, I found BCMenu, and it works pretty nice.:-D