PC Review


Reply
Thread Tools Rate Thread

2 imageLists; no Icons visible in ListView (VB.net 2003)

 
 
bonkers
Guest
Posts: n/a
 
      17th Mar 2004
Yet another bizarre one...

I have a ListView populated with images from an Image List. When the user
selects one of these images, I wish to show an enlarged image in a
PictureBox.

The only way I have managed to do this so far, is to create two ImageLists,
one with the images at 16x16, and another with the images at 140x140. The
ListView's LargeIcon and SmallIcon lists are both from ImageList1.

When the ListView selection changes, it fires an event that captures the
index of the selection, and uses that to set the PictureBox.Image to an
image with the same index -- from ImageList2.

Problem is, for some reason, the ListView no longer displays the icons when
I use LargeIcon view. If I delete ImageList2, the icons show.

Just for the halibut, I tried changing the order of the object declarations
in the form's code. Didn't do anything for me, but I suppose it was worth a
try. I thought maybe imagelist2 was initializing after ImageList1 and
confusing things.

I also tried naming ImageList2 something completely different, and I tried
populating it with copies of the images from a different folder.

So

1) is there a simpler way to get the image that I want to display in the
PictureBox, a way that doesn't involve having two imageLists?

2) Has anyone come across this issue before and found a solution?

Thanks in advance,
Rissa



 
Reply With Quote
 
 
 
 
Elisa
Guest
Posts: n/a
 
      17th Mar 2004
Hi,

ImageLists are probably one of the most buggy components in the current
..NET CF release. I think whoever wrote the ImageList code used
static/shared methods and variables all over the place, in an effort to
safe resources (memory), but the attempt failed misserably...

First of all, for showing pictures in a PictureBox, you should opt for
loading an image as a resource or as a file, instead of loading them
from an ImageList.

Secondly, if you notice disappearing icons in a ListView you could try
to re-assign the ImageList to the ListView. This is usually a necessary
workaround after showing another form that also uses an ImageList.


Regards,

Elisa
 
Reply With Quote
 
Rissa Karpoff
Guest
Posts: n/a
 
      17th Mar 2004

Thanks, Elisa!

Being a newbie to this environmnet, I have yet to figure out how to use
"resources"

However, since there are only a few images, and their file-size is
small, I wouldn't object to copying them to the device.....

BUT, I have not been able to figure out how to assign the external .jpg
to the PictureBox.Image, would anyone be able to help me there?

thanks, again,
Rissa


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
bonkers
Guest
Posts: n/a
 
      17th Mar 2004
Got it elsewhere -- thanks anyway


Elisa <(E-Mail Removed)> wrote in message
news:%3T5c.275$(E-Mail Removed)...
> Hi,
>
> ImageLists are probably one of the most buggy components in the current
> .NET CF release. I think whoever wrote the ImageList code used
> static/shared methods and variables all over the place, in an effort to
> safe resources (memory), but the attempt failed misserably...
>
> First of all, for showing pictures in a PictureBox, you should opt for
> loading an image as a resource or as a file, instead of loading them
> from an ImageList.
>
> Secondly, if you notice disappearing icons in a ListView you could try
> to re-assign the ImageList to the ListView. This is usually a necessary
> workaround after showing another form that also uses an ImageList.
>
>
> Regards,
>
> Elisa



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get visible portion of ListView? Sin Jeong-hun Microsoft C# .NET 2 21st Aug 2006 03:41 PM
Set new item in listview visible Tim Bücker Microsoft C# .NET 2 25th Nov 2004 05:59 PM
Tree/ListView images - are they only from ImageLists? Adam Hearn Microsoft Dot NET Framework Forms 2 18th Jul 2004 11:54 AM
2 imageLists; no Icons visible in ListView bonkers Microsoft VB .NET 0 17th Mar 2004 03:07 AM
Listview Visible Row Count Henry Microsoft VB .NET 10 25th Feb 2004 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:40 PM.