How to: Create a Pen
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

How to: Create a Pen 

This example creates a Pen object.


System.Drawing.Pen myPen;
myPen = new System.Drawing.Pen(System.Drawing.Color.Tomato);

Robust Programming

After you have finished using objects that consume system resources, such as Pen objects, you should call Dispose on them.

See Also

© 2015 Microsoft