This documentation is archived and is not being maintained.

Pen Class

Defines an object used to draw lines and curves. This class cannot be inherited.

For a list of all members of this type, see Pen Members.


[Visual Basic]
NotInheritable Public Class Pen
   Inherits MarshalByRefObject
   Implements ICloneable, IDisposable
public sealed class Pen : MarshalByRefObject, ICloneable,
public __gc __sealed class Pen : public MarshalByRefObject,
   ICloneable, IDisposable
public class Pen extends MarshalByRefObject implements ICloneable,

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


A Pen object draws a line of specified width and style. Use the DashStyle property to draw several varieties of dashed lines. The line drawn by a Pen object can be filled in a variety of fill styles, including solid colors and textures. The fill style depends on brush or texture that is used as the fill object.


Namespace: System.Drawing

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System.Drawing (in System.Drawing.dll)

See Also

Pen Members | System.Drawing Namespace