|
-
Mar 30th, 2004, 11:15 PM
#1
Thread Starter
New Member
Help with ImageList and ListView
Hi Everyone,
I building a program that consists of 14 different forms. On each form, I have a List View control. I'm trying to load the ListView with images from the filesystem (relatively large images) but I don't want to re-load the images from the filesystem on each form. I would like to perform a one-time image load into a globally defined imageList (programatically defined) - then on each form, just pull from the global ImageList.
Anyway - for some reason, I cannot assign the programatically defined ImageList to the ListView controls on each form. It is reporting that my ImageList is equal to "nothing" but I know this is not true.
Any thoughts?
-
Mar 30th, 2004, 11:48 PM
#2
The picture isn't missing
Worked for me:
My form 2 code (loaded from form 1)
Private Sub Form_Load()
ListView1.SmallIcons = Form1.ImageList1
ListView1.ListItems.Add , , "hello", , 1
End Sub
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Mar 31st, 2004, 10:47 AM
#3
Thread Starter
New Member
Hi. Thanks for your input. I think my problem is a little more difficult to solve.
The problem is this: my application has many forms but each form represents a step in a 14 form long process. So each form has a "Back" and "Next" button. When the user clicks on back or next, the current form is unloaded and the new form is loaded. If I attach a ImageList to Form1 (step 1) and click Next (Form2), can i still access controls on Form 1 even if it's unloaded?
My original approach was creating a globallly accessible ImageList through code (via global.bas file) that was populated at the very beginning of the process. This seems to work (in terms of populating the ImageList) but I cannot assign it to the ListView control that exists on each form (each step).
Thanks again,
Kegger
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|