Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ListView - images disappear after coming back from another form with a ListView

3 views
Skip to first unread message

Mark Reddick

unread,
Sep 4, 2003, 9:40:39 AM9/4/03
to
I've got a form with a ListView on it set to LargeIcon view. I have an
ImageList control with some 32x32 icons loaded into it. This ImageList is
associated with the ListView as the LargeImageList. In code, I add items to
the ListView with an ImageIndex and everything works great. The ListView
appears and the items are displayed with their associated image. Now, if I
then click a button that brings up another form that also has an ImageList
on it that has it's image size set to 32,32 that form works ok but when I
close it and return to the first form, all the images are gone. The items
are still in the ListView but all the associated images are blank. I've done
a bit of testing and this happens even if the ImageList on the second form
has nothing in it. If I change the image size of the ImageList on the second
form to 16, 16, when I come back to the first form everything is ok (images
are still there). I tried using small images on the first form (16x16 icons)
and this seems to work all the time (no matter what the ListView is set to
on the second form). It seems to only be an issue if both forms have
ImageList controls on them with an image size of 32x32.

I seem to be able to fix this by setting the LargeImageList again after
returning from the second form. But, I shouldn't have to do that, should I?

I was wondering if anyone else is experiencing the same thing and/or could
verify that this is a bug? Or, perhaps I'm just missing something.

I just created a simple test project that duplicates the issue. I can post
the code if somebody wants to try it.

Thanks,
Mark


Armin Sadeghi [MSFT]

unread,
Sep 5, 2003, 6:41:48 PM9/5/03
to
This is a known issue. The problem arises when you change the imagesize on
any imagelist. At this stage if you have a listview with an imagelist (a
different imagelist ) associated, it will lose its images. The solution is
to set the imagelist again, or to set the size for all your applications
imagelists before you assign any of them to a listview.

-Armin

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Mark Reddick" <mark_r...@NOSPAMlpsg.com>
| Subject: ListView - images disappear after coming back from another form
with a ListView
| Date: Thu, 4 Sep 2003 08:40:39 -0500
| Lines: 30
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <e$CcioucD...@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: proxy.lpsg.com 12.7.1.130
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:32754
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

0 new messages