Custom Form Painting with GDI+

GDI+ represented by the System.Drawing namespace makes advanced form painting and creating custom views ever easier. From the earlier example, it was demonstrated that the Region and GraphicsPath class can be used to create shaped forms.

For simple painting jobs, you can implement a Paint handler for your form or inherit from and override the Paint method for a particular control. The PaintEventArgs object passed to the Paint event contains a reference to the device context, represented by the Graphics object. There are several examples of using the Graphics object earlier in this book, and Chapter 17 provides comprehensive coverage of this subject.

Get Visual Basic® .NET Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.