Vlad77
asked on
Add picture to the menu edit in VB
I want to create my own menu edit (by pressing Ctrl E)
and want to insert a pictures to some sub menues.
For example i want to put diskete picure with "Save" option.
There is a any way to do this ,because i can't find it.
help please.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks,but this isn't exactly what i want.
I want that this icons can be pressed or unpressed
It's mean not only a picture but like an object with states :pressed ,unpressed (like in toolbar).
Is this possible?
I want that this icons can be pressed or unpressed
It's mean not only a picture but like an object with states :pressed ,unpressed (like in toolbar).
Is this possible?
I am not sure that you can acheive this. maybe you will need to provide yourself multiples icons .
anyway, see
http://vbaccelerator.com/codelib/cpopmenu/article.htm
http://www.datadynamics.com/activebar/default.htm
anyway, see
http://vbaccelerator.com/codelib/cpopmenu/article.htm
http://www.datadynamics.com/activebar/default.htm
Any progress?
Just a penny...
stock somewhere the state of the menu items
you could then subclass the object containing the menu
catch the creation of the menu with
WM_INITMENU or WM_INITPOPUPMENU (not sure but you can search in the api viewer)
then
SetMenuItemBitmap
to change the bitmap for check in the menu
or
ModifyMenu
to set a bitmap instead of the normal caption
you put the bitmap in the menu
use two different bitmap for pressed or unpressed
if you need only the checkbox different use the first
then
catch the click of the mouse on the menu
(use WM_ACTIVATE)
with the mouse position use
MenuItemFromPoint API
to determine which menu entry contains the specific point
or
WM_MENUSELECT to know the menu item
remember to unsubclass the object at the end of the process or at the exit of the program
Hope this will help
Wiz
stock somewhere the state of the menu items
you could then subclass the object containing the menu
catch the creation of the menu with
WM_INITMENU or WM_INITPOPUPMENU (not sure but you can search in the api viewer)
then
SetMenuItemBitmap
to change the bitmap for check in the menu
or
ModifyMenu
to set a bitmap instead of the normal caption
you put the bitmap in the menu
use two different bitmap for pressed or unpressed
if you need only the checkbox different use the first
then
catch the click of the mouse on the menu
(use WM_ACTIVATE)
with the mouse position use
MenuItemFromPoint API
to determine which menu entry contains the specific point
or
WM_MENUSELECT to know the menu item
remember to unsubclass the object at the end of the process or at the exit of the program
Hope this will help
Wiz
ASKER
I want that this icons can be pressed or unpressed
It's mean not only a picture but like an object with states :pressed ,unpressed (like in toolbar).
Is this possible?