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?
<br>
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".<br>
<br>
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
<grin><br>
<br>
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.<br>
<br>
When you upgrade to the next version of VB - the MS controls get upgraded automatically and the third party ones do not.<br>
<br>
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.<br>
<br>
I suggest you think carefully before you use 3rd party controls.<br>
<br>
Regards<br>
<br>
Mike<br>
---<br>
Mike_Lacey@Cargill.Com<br>
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.<br>
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."<br>
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).<br>
In the end, only the "intention" of the original application remained.<br>
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.<br>
<br>
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.<br>
<br>
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.
It's your decision - and your ass. <grin> I can't make my advice any clearer without using unladylike language.<br>
<br>
Mike<br>
---<br>
Mike_Lacey@Cargill.Com<br>
Any control, no matter if you create it yourself or purchase it is gonna be a pain in the...<br>
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. <br>
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.<br>
What a pain!!!! I want the old days back when the entire program lives in one directory, and you can upgrade by direct replacement.
<br>
Oops. Looks like I opened a big can o' worms here. <br>
<br>
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.<br>
<br>
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.<br>
<br>
Chip H.<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.