Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
How to: Create a Pen

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

Community Additions

© 2015 Microsoft