Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: image
Hi,
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".
Posted 23-Jul-12 3:40am
RonaR326
Edited 23-Jul-12 5:17am
v2
Comments
Wes Aday at 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 at 23-Jul-12 16:16pm
   
Private Sub Form_Open(Cancel As Integer)
Me.Word.SetFocus
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 at 23-Jul-12 9:10am
   
Wierd problem.Try assigning those images through code .
RonaR at 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 at 23-Jul-12 10:27am
   
Strange! put your source code here.
RonaR at 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)

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 305
2 Richard MacCutchan 270
3 Mathew Soji 220
4 BillWoodruff 210
0 OriginalGriff 8,834
1 Sergey Alexandrovich Kryukov 7,477
2 DamithSL 5,689
3 Maciej Los 5,329
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411028.1 | Last Updated 23 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100