Link to home
Start Free TrialLog in
Avatar of tart666
tart666

asked on

Toolbar refusing to accept Imagelist

VB6 Pro

I draw the toolbar, then go to add the imagelist in its properties.  I select the existing imagelist from the dropdown menu, click Apply.  The imagelist name changes back to <None>.

I tried assigning the imagelist at runtime: toolbar1.imagelist=imagelist1
the button size changes to reflect the image size, but no images.

This happens even in the wizard-created empty MDI app: if I deselect the imagelist from the toolbar, click apply, then try to select the imagelist again -- it does not work.

???
ASKER CERTIFIED SOLUTION
Avatar of Tommy Kinard
Tommy Kinard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tart666
tart666

ASKER

In the toolbar properties, on the button tab, the image field remains grayed out.  Cannot get that to enable.
Avatar of tart666

ASKER

OK, some progress, thx dragontooth.  Specifying the image number at runtime seems to help:

Toolbar1.ImageList = ImageList1
Toolbar1.Buttons.Item(1).Image = 1
Toolbar1.Buttons.Item(2).Image = 2
Toolbar1.Buttons.Item(3).Image = 3

Any way to do all this at design time?  Each time I add the ImageList to the Toolbar properties window, it gets rejected and changed back to <None>...
Yes there is let me look at it and I will return with (what I hope) step by step instructions.

dragontooth

http:Q_20723249.html

The above link should help some but I will continue looking.

dragontooth

btw I have done this before it has just been a while so I have to refresh my old brain :-)
Avatar of tart666

ASKER

>>Place an ImageList on the form. In the properties at the top pick custom.On the dialog box that appears at the top you will see Images pick the tab. At the bottom there is a button Insert Picture pick that. Insert the icons you already have (I hope). when through pick OK. You have the icons in the control.
On the toolbar right click and pick properties, Under the general tab there will be the imagelist box pick the drop down menu and select the ImageList1 (this is the default name).
Now pick the Buttons tab at the top. go through the buttons assigning the icon you wish.

Yep, that's what I do... still the toolbar does not accept the imagelist at design time...
tart666 Thanks for the points and the grade!

Did that work I have the feeling that it didn't. I am having no problems assigning the icons at design time I may be missing something here. I am still willing to help you get this fixed.

dragontooth


Is the imagelist populated at design time or run time?
Avatar of tart666

ASKER

imagelist is created and populated at design time.  No changes at runtime.

I mentioned before, even in the canned wizard-created MDI app, after I disassociate the imagelist from the toolbar, I cannot get it to hook back up....

I will stop trying, and use the workaround...  thx guys