Reader Level:
Article

Drawing With no OnPaint Method

By Mahesh Chand on Aug 09, 2001
In this sample example, I draw GDI+ objects on button click.
Download Files:
 

Couple of people have asked on discussion forums about drawing with no OnPaint method or event. 

Why OnPaint method? The main reason is we can get Graphics object easily on paint method. Actually painting with no OnPaint method is very simple. Just you need Graphics object for the form you're drawing on.

In this sample example, I draw GDI+ objects on button click.

Mahesh Chand

C# Corner founder, 10-times Microsoft MVP, technical author, and software architect. Mahesh authored his first book, A Programmer’s Guide to ADO.NET in C# with APress at the age of 25. C# Corner is a memb... Read more

COMMENT USING