Important alert: (current site time 7/16/2013 3:41:40 AM EDT)
 

winzip icon

CoolMenu (real icon menus)

Email
Submitted on: 5/9/2000 9:54:47 AM
By: Olivier Martin 
Level: Advanced
User Rating: By 33 Users
Compatibility: VB 5.0, VB 6.0
Views: 40863
 
     

Display real Office like icon menus.

Source code based on Paul DiLascia's work from the Microsoft System Journal (Jan98); ported from VC++ to VB by me + some adaptation. visit www.dilascia.com

**Features:
Real Office like icon menus;
Partial Win98 main menu effect in Win95 (need help for full effect if possible);
Embossed pictures in color (thanks Paul);
Uses the form's font (~and style attributes);
Working "local" and "global" accelerators (&, Ctrl+?);
Easy interfacing between ImageList and VB's Menu Editor;

Take a look at the screen shot !

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/9/2000 12:32:24 PMOmar

Hi This is A Very Great Code.

Can I Please Have Your PERMISSION TO Post This Code On My Web Sit?

http://www.omarswan.cjb.net

(If this comment was disrespectful, please report it.)

 
5/9/2000 12:34:01 PMPete Sral

This is it! Code that uses the ImageList and the use of the Tab in the ImageList (great idea!!!). No more picture boxes, no more picture arrays! Great code!
(If this comment was disrespectful, please report it.)

 
5/9/2000 12:54:37 PMOlivier

Go ahead and post it, just make a link to this site with my name somewhere
(If this comment was disrespectful, please report it.)

 
5/9/2000 3:00:10 PMOmarSwan

Hi Oliver It's Me Again.
First I must Thank you for giving me the permission to post the code on my web site.

Do you have any tutorials or information as to how to impement this in another program. (for example : - What f the user does not want to use the imagelist control, what can he/she use instead)

Thanks Again.
May God Bless You

(If this comment was disrespectful, please report it.)

 
5/9/2000 4:27:43 PMsiph0n

great code, very easy to use and change for programmers needs. make sure you end the program by unload the form and not using the stop command in the IDE or VB will shutdown because it has to unload the class.
(If this comment was disrespectful, please report it.)

 
5/9/2000 6:38:25 PMOlivier

Well Omar, the use of the ImageList is hardcoded in the CoolMenu class. That is, the icons are extracted and drawn using API calls in the DrawItem function. The main purpose of the imagelist is to spare the user the complecated task of collecting images in one location.
(If this comment was disrespectful, please report it.)

 
5/10/2000 8:11:15 AMOlivier Martin

Double oops... a few minutes ago I accidently delete a comment from Pietro Cecchi (cecchi@etrurianet.it) that said :
Hi Oliver,
at the end someone who cares of elegance!
I just downloaded your code, and I saw that frmtest.frx is missed (that contains the icons).
Please send it to me.
Besides, I would ask you if it is possible to add a MenuItem_MouseMove event, to serve a help text box with the meaning of the menu item, while the cursor goes on it.
A MenusItem_Forecolor Property (id est same forecolor as the one of the form) also, would be very nice to have!

Sorry about that, I fixed the zip and reposted it. I'll start working on the suggested improvement and will propably post a CoolMenu update soon. For those of you who want to try it, go play with OnMenuSelect and OnDrawItem
(If this comment was disrespectful, please report it.)

 
5/10/2000 11:55:22 AMVBMoose

Probably the best icon menu code I've seen.. I turned it into an activeX control in no time. Works like a charm.
(If this comment was disrespectful, please report it.)

 
5/10/2000 10:43:32 PMJeffrey Drake

I have tried to integrate your menu code into my program, but it gives an illegal function call. I have to try to stop the program or debug but I can't see where it is doing the error.

My code is available if you wanted to look at it.
I basically put the code into my project the way you had it. I already had a premade application (by the wizard) and had extended it somewhat.
Regards,
Jeffrey Drake
(If this comment was disrespectful, please report it.)

 
5/10/2000 11:05:23 PMRobbie

hi, is there anyway to make your code so that when you end/stop the example vb doesn't always crash? Anyways i think your code is great, Keep up the GREAT work!
(If this comment was disrespectful, please report it.)

 
5/11/2000 10:20:31 AMOlivier Martin

To Jeffrey and Robbie:
the program will always crash vb when you click on the "stop" button or if you try to break the execution.
Send me your code if you want.
(If this comment was disrespectful, please report it.)

 
5/13/2000 9:45:02 AMtsi

Thank You!
(If this comment was disrespectful, please report it.)

 
5/13/2000 9:58:36 AMtsi

Me again.
I am getting an illeagal procedure call on this line:
Set Item = mCol(vntIndexKey)
In the class CMyItemDatas

Help would be appreciated.
What I can get looking is pretty good!
(If this comment was disrespectful, please report it.)

 
5/15/2000 12:49:28 PMOlivier Martin

I suggested a few corrections to my code because "tsi" is using a MDI environment. I'm not posting them because it's not a "common" use of CoolMenu (I hope)
I'll make the required tests on MDI forms before releasing the CoolMenu update in June!
The new version will include Checks and Radio menus as well as many bug fixes
(If this comment was disrespectful, please report it.)

 
5/18/2000 5:07:38 AMPatrick van Geenen

Hello you all,Great Code, but would it be possible to receive the
(If this comment was disrespectful, please report it.)

 
5/18/2000 9:31:13 AMOlivier Martin

the what ?
It seems there's a problem with the feedback form, It's impossible to leave a complete msg when your not logged
(If this comment was disrespectful, please report it.)

 
5/18/2000 11:35:33 AMPatrick van Geenen

About the...
The reason why was indeed I was not "registered". The sentence ended with. ... the "update" as I'm also trying to use CoolMenu in an MDI form, and seem to have the same bug as tsi. Help would be appreciated a lot.
Thanks!






(If this comment was disrespectful, please report it.)

 
5/25/2000 10:08:05 PMsiph0n

i am getting an out of stack space error after i click my menu to popup, then click a menu or off the menu, it highlights: Set pmds = Nothing


(If this comment was disrespectful, please report it.)

 
5/25/2000 10:18:27 PMOlivier Martin

What ?!
I'll need more info so I can reproduce the conditions of the error and correct it (maybe...)
(If this comment was disrespectful, please report it.)

 
5/30/2000 4:12:57 AMSeth DK

This code is very cool, and usefull, but I have a little problem when using it on MDI forms. I'm not a professional, so would you please help me with this problem? By the way...How do you change the font to not-bold om a MDI-form when there's not any Font-property?
(If this comment was disrespectful, please report it.)

 
5/30/2000 10:21:09 AMOlivier Martin

MDI forms cause some problems. I'm still working on it and hope to find solutions very soon. There is a font property in the new version but it's not ready yet
(If this comment was disrespectful, please report it.)

 
5/30/2000 8:02:23 PMPaul Dexter C. Bacani

Thank you for showing us that it's possible.
(If this comment was disrespectful, please report it.)

 
5/30/2000 11:07:35 PMOlivier Martin

Hummm... Paul Dexter
Your name tells me something...

Thank you very much. I learned just a few weeks ago that MANY things ARE possible when I got around the MenuFromPoint bug. If you're impressed, wait until you see the next version...
(If this comment was disrespectful, please report it.)

 
5/31/2000 1:50:39 AMSeth DK

This version is so cool (except the bug with the MDIform thing), so I just can't wait to see the next one.
(If this comment was disrespectful, please report it.)

 
6/6/2000 6:53:23 PMMatt

I am trying to use your menu with a system tray icon. Everytime when I exit it causes vb to have an error and close. I can click on stuff on that menu it only happens when I close it. I am not using End anywhere and it works fine on all the other forms. Does your menu have a problem working with system tray icons? Thanks.
(If this comment was disrespectful, please report it.)

 
6/7/2000 11:01:21 AMOlivier Martin

I have tested CoolMenu (in its current version) with Systray icons and the menu works fine; just as expected.

The only problem you could have is when you unload your form. You must use the "Install" function with a null form handle (0) just like in the example. If not, or if you press the stop button in the IDE, vb will crash. That's a well know subclassing fact.(believe me, you learn it pretty fast) Good luck
(If this comment was disrespectful, please report it.)

 
6/7/2000 5:24:38 PMMatt

I am using multiple forms with it. I load it on the main form that has the systray icon and unload it in the that form. I can install the CoolMenu everywhere and exit and get no errors. But when I install it on the main form with it gives me an illegal operation everytime and closes Vb.
(If this comment was disrespectful, please report it.)

 
6/19/2000 10:14:17 PMetrask

WOW! Great code! this is very useful and also gives your application a very professional look to it. Good work!
(If this comment was disrespectful, please report it.)

 
6/22/2000 10:54:31 AMMauricio Cunha

Really, this idea is very cool !
(If this comment was disrespectful, please report it.)

 
6/23/2000 9:49:44 AMJachym

Hi, very cool code. Can I have permission to publish it on our VB site (www.czechia.com/vbasic),please?
(If this comment was disrespectful, please report it.)

 
6/23/2000 11:04:13 AMOlivier Martin

Yes Jachym, you can post my code on your site. But I want my name on it and you'll have to do the traduction.
I suggest you use the leatest version however. Search for "CoolMenu" or browse in "my other submissions" (1)
(If this comment was disrespectful, please report it.)

 
6/26/2000 6:46:09 AMVasilis Sagonas

!!!!!!!!!! I LOVE YOU !!!!!!! That's EXACTLY What I was looking for!!!!!!
(If this comment was disrespectful, please report it.)

 
6/26/2000 6:51:06 AMVasilis Sagonas

Sorry! I was impressed :))) This is a great idea and great code! Great great!!! Can I use it in a freeware program i prepare? (http://www.dawn.gr/netfly) for its new version ?
(If this comment was disrespectful, please report it.)

 
6/26/2000 10:08:43 AMOlivier Martin

You can use my CoolMenu your app, but I'd like you to add my name somewhere. You should also use the latest version : browse my "other submissions" (1) or search for "CoolMenu"
(If this comment was disrespectful, please report it.)

 
2/24/2001 10:12:21 PMGreg C.

This is good! I have been using The icon in menu code from http://vbthunder.com for some time now but I have to say this is much better(Except for the freeze when you push the stop button!)I have also tried http://vbaccelerator.com s put that crashes if you use it for right click menus! This is the best example!(I have tried your newer code but it is not this simple!, What code do I use to make those neet seporaters??)
(If this comment was disrespectful, please report it.)

 
2/24/2001 10:14:36 PMGreg C.

This is good! I have been using The icon in menu code from http://vbthunder.com for some time now but I have to say this is much better(Except for the freeze when you push the stop button!)I have also tried http://vbaccelerator.com s put that crashes if you use it for right click menus! This is the best example!(I have tried your newer code but it is not this simple!, What code do I use to make those neet seporaters, in Version 1.3??)
(If this comment was disrespectful, please report it.)

 
3/25/2001 6:27:25 PMIgnacio Nelson

Hi there. hey can i use this code on Xtremepad? u can find it here, it's a complete text editor. i'll put your name on it =]
(If this comment was disrespectful, please report it.)

 
7/12/2001 7:00:49 AMOwais Muhammad

I tried to use your code but it only one image comes in all the menus please tell me how to fix it. Please give me your email address at amowais@hotmail.com
(If this comment was disrespectful, please report it.)

 
2/11/2002 6:43:36 PMWhoisit

I've not even unzipped it yet and I'm already impressed!!!!!!!!
(If this comment was disrespectful, please report it.)

 
3/15/2002 7:21:37 AMNyXZ

I doesn't draw the icons in winXP.
The small 'box' is drawn in the menus, but no icons. (or maybe it's me? >)
(If this comment was disrespectful, please report it.)

 
4/28/2002 5:46:35 PMJuan Rodriguez

This system dosn't work in WinXP, i tried to change the windows commaon control's version, and it works just before corrupt the icons on the imagelist, any idea?
(If this comment was disrespectful, please report it.)

 
12/17/2002 10:52:27 PM

The menus appear to work correctly but
when I exit my program it crashes in
Kernel32.dll ..... the program won't
exit/quit cleanly..... I stepped thru
the program for a long time and I think
it dies in mCoolMenu in WindowProc but
can't be sure.... Has anyone seen this
or know how to debug it?
Regards
-Tim
(If this comment was disrespectful, please report it.)

 
2/5/2003 3:36:51 AM

Great code Olivier! I've been looking for this for a long time and all were using picture box.
(If this comment was disrespectful, please report it.)

 
2/5/2003 6:46:47 AM

thanks for you help

god bless u
(If this comment was disrespectful, please report it.)

 
8/18/2009 3:07:20 AMMugundan

Hi, when i compile to make an application, the main menu only changed but all the submenus remains the same without ICONS & FONTS.

However when i run thro' VB, it works.

Can u have any idea.

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.