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?
4 Replies - 3153 Views - Last Post: 02 February 2012 - 02:04 PM
#1
Problem with Listview control - disappearing images
Posted 02 February 2012 - 09:43 AM
Replies To: Problem with Listview control - disappearing images
#2
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.
#3
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.
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.
#4
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.
If you regenerate the code and produce the same results, post it, maybe it might kick my brain back into gear on the subject.
#5
Re: Problem with Listview control - disappearing images
Posted 02 February 2012 - 02:04 PM
CharlieMay, 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.
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
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|