linuxfedora@yahoo.com.hk wrote:
> if i want to draw something on the control, then how can i do it?
> For example, when i call function named WriteSomeThingOnPanel(),
>
> Then there will be a line drawn on Panel?
>
> I have tried to get the Graphics of the Panel by
> Graphic.FromHwnd(panel.Handle);
> then draw the line, but nothing can be drawn?Thanks
>
You use the Paint event, just as in the code that you posted. The event
arguments contains a reference to the graphics object that should be
used for drawing, just as in the code that you posted.
To trigger the Paint event, you call the Invalidate method on the control.
--
Göran Andersson
_____
http://www.guffa.com