I have a listbox of which I have overrode the 'DrawItem' event to
display an image.
So I have a function as follows:
private void DrawItemHandler(object sender, DrawItemEventArgs e)
{
Bitmap img = new Bitmap("cross.gif");
e.DrawBackground();
e.DrawFocusRectangle();
Image i = img;
e.Graphics.DrawImage(i, new Point(e.Bounds.X,
e.Bounds.Y));
}
-
What I want is a button which will scan all items in the listbox,
check to see whether the item exists in the database, and then change
the image accordingly ("tick.gif").
-
What is the best method of doing this?
I can check which the image should be easily enough, but i cant pass a
value to the DrawItemHandler. Or can I?