Form what I have done so far in my program, it seems that the only way to draw anything on a winform is through System.Windows.Forms.PaintEventArgs. What if you don't have access to these arguments or this namespace and you only have access to the winform, how do you draw (say a shape like a rectangle) on a winform.
Thanks in advance.
If you want to draw on the form (or any other control) outside of the
Paint
event, you have to get theGraphics
object for that control. Then you can paint to your heart's content. Note, however, that the next time a paint message comes along, what you've drawn is likely to be erased.To draw on the form: