Click here to Skip to main content
14,937,943 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have designed a form and put an imagecombobox on it, also imagelist as a container for the images. Everything works fine, when I switch from the design of the form to see the form. But when I open the form by clicking the button to open that form from the main form, the image combobox comes empty. When I just go to design, then switch back to form, the imagecombox has images. What is going on? Why the imagecombobox does not have image in a compile mode? Why when I go to design and then switch back to a form, the images show up? How to solve this issue?
Thanks, Rona

This code doesn't work:
Me.ImageCombo7.AutoLoad = true and there is no option in the imagecomboboxcomponent to select "AutoLoad".
Updated 23-Jul-12 4:17am
[no name] 23-Jul-12 9:02am
How are we supposed to know? We cannot see your code, your project, your hard drive or read your mind.
RonaR 23-Jul-12 16:16pm
Private Sub Form_Open(Cancel As Integer)
Me.Word.Text = ""
Dim ImageList6 As ImageList
Dim ImageCombo7 As ImageCombo
Dim objnewItem As ComboItem

Set ImageCombo7 = Me.ImageCombo7.Object
Set ImageList6 = Me.ImageList6.Object
Set ImageCombo7.ImageList = ImageList6

Set objnewItem = ImageCombo7.ComboItems.Add(1, "a", "a", "a") '1-pervyi -poriado risunkov of deopdown
objnewItem.Indentation = 1
Everything works fine...but when i open the form from the main form, the imagecombo is not populated. Either i need to set up a default value for the image combo, so when the form opens the imagebox is populated, or autoload all pictures on the Open event of the form. Please, help!
dimpledevani 23-Jul-12 9:10am
Wierd problem.Try assigning those images through code .
RonaR 23-Jul-12 16:14pm
I did!
Set objnewItem = ImageCombo7.ComboItems.Add(1, "a", "a", "a") and they show up and allow selection when I switch from design mode to Form acNormal. But when i open the form from the main form...the imagecombo comes empty.
Rajesh Varma Buddaraju 23-Jul-12 10:27am
Strange! put your source code here.
RonaR 23-Jul-12 12:26pm
Me.ImageCombo7.AutoLoad = true This line doen't work!
What if just to set a default value to an imagecombo? Then the form will open up with the combobox already populated with an image, but
Me.ImageCombo7.Default = Me.ImageCombo.ComboIems(1) also is not working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900