Solved

Add picture to the menu edit in VB

Posted on 2002-05-24
7
159 Views
Last Modified: 2010-05-02

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.
0
Comment
Question by:Vlad77
7 Comments
 
LVL 20

Accepted Solution

by:
hes earned 50 total points
ID: 7033244
0
 

Author Comment

by:Vlad77
ID: 7033349
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?
0
 

Author Comment

by:Vlad77
ID: 7033350
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?
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7033357
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
0
 

Expert Comment

by:unni_bcanti
ID: 7033774
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7128810
Any progress?
0
 

Expert Comment

by:WizOfOz
ID: 7190840
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
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question