I do this:
:
form->Paint += new PaintEventHandl er( this,
$ThisClass::Pai nt_Event_Handle r ) ;
:
void Paint_Event_Han dler( Object^, PaintEventArgs^ e)
{
Graphics^ graphics = e->Graphics ;
// use graphics to draw your primitives here, like this:
Pen^ pen = gcnew Pen(Color::Red) ;
graphics->DrawRectangl e( pen, 0, 0, 20, 20 ) ; // etc.
}
Note this draws your graphics every time the 'form's Paint event occurs.
This happens whenever some portion of 'form' is covered and then uncovered.
Hence, to actually SEE the graphics drawn in this way you need to execute
form->Refresh() to put on the screen what your drawing in the Paint event (I
think Refresh() causes the Paint event to fire, or at least executes the
Paint event handler).
This was all assuming /clr syntax in 2005. If you do use 2005, then I
STRONGLY recommend setting the DoubleBuffered property of your 'form' to
true, this will eliminate any flicker you might get. I personally also
double buffer manually, but that's another topic... : )
[==P==]
"iwdu15" <iw****@discuss ions.microsoft. com> wrote in message
news:8A******** *************** ***********@mic rosoft.com...
how would i do that? like i have my lines being drawn on a mousemove event
of
a panel...is there a simple way to save them without using overloaded
functions?
--
-iwdu15