Hi, this looks the easiest to me: store MouseDown point in pt1, current MouseMove position in pt2, and in OnPaint for both x and y do:
xMin= x1<=x2 ? x1 : x2;
width= x1+x2-xMin -xMin; // x1+x2-xMin is xMax!
ADDED: then Graphics.DrawRectangle(..., xMin, yMin, width, height); BTW: You might want to add 1 to width/height to always see the rectangle... :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use PRE tags to preserve formatting when showing multi-line code snippets