J
Jim Bancroft
I'm trying to draw a red rectangle over a picturebox, with some luck.
Problem is, the rectangle only flashes, then disappears, as though a repaint
keeps taking it away. Here's a code snippet from my method:
pictureBox1.CreateGraphics().FillRectangle(bsh, new Rectangle(x, y, 30,
30));
pictureBox1.Invalidate(new Rectangle(x,y,30, 30));
pictureBox1.Refresh();
I've tried various things...invalidating the entire picturebox, calling
Update() instead of Refresh...everything but the kitchen sink. I guess I
need a better grounding in what to do in situations like this. My paint()
method on the form is generic, I haven't done anything to it. Thanks for
the help!
Problem is, the rectangle only flashes, then disappears, as though a repaint
keeps taking it away. Here's a code snippet from my method:
pictureBox1.CreateGraphics().FillRectangle(bsh, new Rectangle(x, y, 30,
30));
pictureBox1.Invalidate(new Rectangle(x,y,30, 30));
pictureBox1.Refresh();
I've tried various things...invalidating the entire picturebox, calling
Update() instead of Refresh...everything but the kitchen sink. I guess I
need a better grounding in what to do in situations like this. My paint()
method on the form is generic, I haven't done anything to it. Thanks for
the help!