k0ndi
asked on
The "ImageList must be initialized before it can be used" VB 6.0 error
Hello!
I have a VB 6.0 problem. Let's go through step by step:
1. I add Microsoft Windows Common controls 6.0(SP4)
2. I add these 3 components on the form:
imageCombo1 representing ImageCombo control
imageList1 representing ImageList control
command1 representig a CommadnButton.
Let's look at the code:
Private Sub Command1_Click()
ImageList1.ListImages.Add 1, "ImageKey", LoadPicture("c:\test.bmp")
ImageCombo1.ComboItems.Add 1, "ItemKey", "This is a test item", "ImageKey"
End Sub
Now when pressing the command button I get this error : "ImageList must be initialized before it can be used"
Thanks for all your help.
Regards,
Peter
I have a VB 6.0 problem. Let's go through step by step:
1. I add Microsoft Windows Common controls 6.0(SP4)
2. I add these 3 components on the form:
imageCombo1 representing ImageCombo control
imageList1 representing ImageList control
command1 representig a CommadnButton.
Let's look at the code:
Private Sub Command1_Click()
ImageList1.ListImages.Add 1, "ImageKey", LoadPicture("c:\test.bmp")
ImageCombo1.ComboItems.Add
End Sub
Now when pressing the command button I get this error : "ImageList must be initialized before it can be used"
Thanks for all your help.
Regards,
Peter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad could make help :-) yet any reason why a "B" is awarded instead?
ASKER
Sure! You mistyped yourself. I knew what you meant instantly, but someone could have problems with it for about 10 seconds :-) I had to rightclick the ImageCombo not Imagelist. No offence.
ASKER