Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Pen.DashStyle Property

Gets or sets the style used for dashed lines drawn with this Pen.

Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)

public DashStyle DashStyle { get; set; }
/** @property */
public DashStyle get_DashStyle ()

/** @property */
public void set_DashStyle (DashStyle value)

public function get DashStyle () : DashStyle

public function set DashStyle (value : DashStyle)

Not applicable.

Property Value

A DashStyle that represents the style used for dashed lines drawn with this Pen.

Exception typeCondition

ArgumentException

The DashStyle property is set on an immutable Pen, such as those returned by the Pens class.

A value of Custom for this property specifies that a custom pattern of dashes and spaces, defined by the DashPattern property, makes up lines drawn with this Pen. If the value of this property is Custom and the value of the DashPattern property is a null reference (Nothing in Visual Basic), the pen draws solid lines.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2015 Microsoft