4 Replies - 3900 Views - Last Post: 02 February 2012 - 02:04 PM Rate Topic: -----

#1 neverhome  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 21-December 10

Problem with Listview control - disappearing images

Posted 02 February 2012 - 09:43 AM

With .Net 3.5 / VB 2008 / WinXP...
I'm using a Listview control in Details view. Two columns with an image on the left and text on the right. FullRowSelect is set to true. All works fine except that in the selected item the image is not visible. It's replaced by a white background. I need the image to be visible within the selected ListViewItem's blue background. Do I need to switch to OwnerDraw or is there another way to keep the image visible?

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with Listview control - disappearing images

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,839
  • Joined: 02-June 10

Re: Problem with Listview control - disappearing images

Posted 02 February 2012 - 10:07 AM

Don't dispose of it. Just a guess as we have no code from what you are doing. But I would guess that it is being disposed of elsewhere or going out of scope and be garbage collected.
Was This Post Helpful? 0
  • +
  • -

#3 neverhome  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 21-December 10

Re: Problem with Listview control - disappearing images

Posted 02 February 2012 - 01:04 PM

"Don't dispose of it."

It's not disposed. All I was doing was getting the text value from the selected item. The ItemCollection is generated when the control is created and is unchanged until the control itself is disposed.

I can't provide any code at the moment because I became frustrated with the thing and replaced it with a DataGridView. Once the headers and cell borders are dealt with it looks basically the same but the images stay put when I click a row.

I may yet go back and try to figure out what was going on. Seems like odd behavior to me.
Was This Post Helpful? 0
  • +
  • -

#4 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Problem with Listview control - disappearing images

Posted 02 February 2012 - 01:51 PM

I seem to remember running into an issue with something like this but I can't for the life of me remember the specifics. For some reason I thought it had something to do with the different imagelist properties (ie, LargeImageList, SmallImageList and StateImageList)

If you regenerate the code and produce the same results, post it, maybe it might kick my brain back into gear on the subject.
Was This Post Helpful? 0
  • +
  • -

#5 neverhome  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 21-December 10

Re: Problem with Listview control - disappearing images

Posted 02 February 2012 - 02:04 PM

View PostCharlieMay, on 02 February 2012 - 01:51 PM, said:

I seem to remember running into an issue with something like this but I can't for the life of me remember the specifics. For some reason I thought it had something to do with the different imagelist properties (ie, LargeImageList, SmallImageList and StateImageList)

If you regenerate the code and produce the same results, post it, maybe it might kick my brain back into gear on the subject.

I may tinker with it tonight. If so I'll pass along the code.
Thanks - AB
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1