Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Displaying an icon/image in a menu

Displaying an icon/image in a menu

Displaying an icon/image in a menu

I am a student and was curious if there is a way to place an image next to a menu selection. I know that the check mark can be placed rather easily but is there a way to place an image or an icon?

RE: Displaying an icon/image in a menu

It's possible to add graphics to menus, using Win32 API calls, but it's a tad messy. See Daniel Appleman's book about the Win32 API for VB programmers. A 'must-have' book in any case. Look up "Owner-draw".

The other way to do it (and much easier, IMO), is to use an OCX that does it for you. I've used the ActiveBar control from Data Dynamics with good results. You can have menus, toolbars, button bars, a bunch of stuff. There are likely many other controls with similar functionality out there. Take a look at http://www.vbxtras.com, they sell a lot of different controls.

Chip H.

RE: Displaying an icon/image in a menu

ActiveBar Rules!!! for doing what you want to do, and many other tasks.

RE: Displaying an icon/image in a menu


I'm sure that Data Dynamics are a fine company - that there are *many* fine companies that produce controls for the MS Visual environments - but bear this in mind.

When you upgrade to the next version of VB - the MS controls get upgraded automatically and the third party ones do not.

This doesn't sound like a big deal - and it isn't until you have to do it on an application with a large number of 3rd party controls and then it's hard (and boring) work that means working with the text versions of your forms.

I suggest you think carefully before you use 3rd party controls.



RE: Displaying an icon/image in a menu

The third party controls are fantastic. You can save yourself hours and hours of development time by filling your forms with these artful doo-dads. Just click&drag to give your app functionality.
And they make upgrading the VB version a rewarding, educational experience. A few months ago my company asked me to convert a large VB2 application to VB6 and write some routines to make it HP3000 friendly. "No problem," I thought, "most of the code is already written and in working order."
In my opinion, Mike Lacey didn't state the case with accuracy. The work wasn't HARD (torture with red-hot pokers springs to mind). The work certainly wasn't BORING (I had a lot of people breathing down my neck while making all sorts of usefull suggestions).
In the end, only the "intention" of the original application remained.
Hundreds a asprins after I took on the project, I understand the procedure for upgrading such an app; study the logic, make notes on the interface, click on the folder containing the originals and press the delete key.

Every company should have a strongly-worded section in their manual discouraging the use of the third-party controls. The convenience you gain today will be a royal pain-in-the-arse for some poor sap a few years from now.

RE: Displaying an icon/image in a menu

Is there a happy middle ground? (regarding third party controls). How about sticking with mainstream/reliable vendors? I converted a VB3 app. to VB5 and was able to find OCX versions of the VBX's without TOO much difficulty.

RE: Displaying an icon/image in a menu

It's your decision - and your ass. <grin> I can't make my advice any clearer without using unladylike language.


RE: Displaying an icon/image in a menu

Any control, no matter if you create it yourself or purchase it is gonna be a pain in the...
I have 15 sites, each with 5 to 20 PC's with my program on them, and I just found a bug in one of my "home built" controls. Or maybe I get an update from one of my vender build controls.
MS in their infident wisdom says you can't replace the control - you have to do an install i.e. unregister/register the new control.
What a pain!!!! I want the old days back when the entire program lives in one directory, and you can upgrade by direct replacement.

RE: Displaying an icon/image in a menu

those were the days....

RE: Displaying an icon/image in a menu


Can't you just do this?

regsvr32 /u yourcontrol.ocx
copy newone.ocx c:\win\system32
regsvr32 newone.ocx

RE: Displaying an icon/image in a menu

Yeah, but I have to be on site. We do most of our upgrading by NT RAS, over the phone line.

RE: Displaying an icon/image in a menu

Oops. Looks like I opened a big can o' worms here.

When I said that I had had good results with ActiveBar, I meant it. What I didn't say was that we'd gone through nearly every other menu/toolbar control on the market before deciding they all suck or majorly suck for one reason or another, and that ActiveBar was the best available for us and our products.

Our general policy is to depend on a very few, very good controls. The rest we write ourselves. Some of the third-party stuff we encapsulate in our own controls (depends on the license, and whether it'll work encapsulated). That way we control the programming interface that's visible to the rest of our code, in case we have to swap out controls at a future date.

Chip H.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close