How to: Set the Color of a Pen

This example changes the color of a pre-existing Pen object

myPen.Color = System.Drawing.Color.PeachPuff;

This example requires:

  • A Pen object named myPen.

You should call Dispose on objects that consume system resources (such as Pen objects) after you are finished using them.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft