I'm having an issue that I can't quite figure out. I have a
PictureBox that initially sets a picture from an embedded resource.
The user clicks a listview item and if an image url is available, it
sets the ImageLocation property to the url of the image and loads it.
Then if the user clicks a ListView item without an image url, the
default embedded image is displayed. This all works great, but if I
click an item with an image url, then one without, after a second the
previous image is displayed, replacing the default. I've run it
through a debugger and it doesn't catch where the change is happening,
I only set the image twice in my code from one method, once to set the
image from a URL, once to set it from the resources. Debugging
doesn't pick up where it gets reverted back and I don't know where to
look. There's no "ImageChang ed" type event so I can't watch for that.
Here's the code where it changes:
private void lstAds_Selected IndexChanged(ob ject sender, EventArgs e)
{
foreach (adComponents ad in clsock.adList.K eys)
{
if (lstAds.Focused Item.SubItems[1].Text ==
ad.description)
{
if (ad.hasPic)
pbxPreview.Imag eLocation = ad.picLink;
else
pbxPreview.Imag e =
Image.FromStrea m(
this.GetType(). Assembly.GetMan ifestResourceSt ream(
"creader.Resour ces.noimg.png") );
break;
}
}
}
I really don't know what to do now. If you need any other info, let
me know.
Thanks,
Brandon
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
http://www.usenet.com