Solved

Toolbar refusing to accept Imagelist

Posted on 2003-10-28
9
831 Views
Last Modified: 2013-12-25
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.

???
0
Comment
Question by:tart666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 14

Accepted Solution

by:
Tommy Kinard earned 125 total points
ID: 9636654
This may be silly but have you entered the number of the image in the imagelist1 for that button?

dragontooth



0
 

Author Comment

by:tart666
ID: 9636673
In the toolbar properties, on the button tab, the image field remains grayed out.  Cannot get that to enable.
0
 

Author Comment

by:tart666
ID: 9636713
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>...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 9636767
Yes there is let me look at it and I will return with (what I hope) step by step instructions.

dragontooth

0
 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 9636790
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 :-)
0
 

Author Comment

by:tart666
ID: 9636882
>>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...
0
 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 9637401
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


0
 

Expert Comment

by:mshieh
ID: 9637913
Is the imagelist populated at design time or run time?
0
 

Author Comment

by:tart666
ID: 9639438
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 61
How to debug this code 7 65
Access 2013 combo box not working 3 58
Visual Studio 2005 text editor 10 48
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

749 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