here's the form that uses the SelectionBox class
Printable View
here's the form that uses the SelectionBox class
Hmm, seems overly complicated. I'd suggest dropping the SelectionBox class unless you need to store more information about the selection then a rectangle.
Add these lines to the constructor of your form.
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint , true);
this.SetStyle(ControlStyles.UserPaint, true);
Then, just draw what you need to draw in your paint event handler. Probably just change the call to SelectionBox.Draw() to Graphics.DrawRectangle(). No need to worry about flicker. The lines I said to add to the constructor will tell the system to take care of take. You could read about double buffering to understand what it's doing but you don't need to know how it works to use it.
Thank you Scott, u were right :)