GpDashStyle enumeration
Selects the line style of a pen: solid, one of four predefined dash patterns, or a custom pattern.
The lengths in a predefined pattern are multiples of the pen width. Setting DashStyle on a pen replaces its dash pattern with the predefined one, and setting the DashPattern of a pen changes its style to DashStyleCustom.
| Member | Value | Description |
|---|---|---|
| DashStyleSolid | 0 | A solid line. |
| DashStyleDash | 1 | A line of dashes. |
| DashStyleDot | 2 | A line of dots. |
| DashStyleDashDot | 3 | A line that alternates a dash and a dot. |
| DashStyleDashDotDot | 4 | A line that alternates a dash and two dots. |
| DashStyleCustom | 5 | A user-defined pattern, set with the DashPattern property of the pen. |
Used by
Example
Dim user As GdiPlusUser = GdiPlusUser()
Dim p As Pen = Pen(Color(CColor.Red), 1)
Debug.Print p.DashStyle = DashStyleSolid
Debug.Print p.DashPatternCount
p.DashStyle = DashStyleDash
Debug.Print p.DashPatternCount
Dim pattern(1) As Single
pattern(0) = 2
pattern(1) = 1
p.DashPattern = pattern
Debug.Print p.DashStyle = DashStyleCustom
' Output:
' True
' 0
' 2
' True
See Also
- DashStyle – Microsoft’s documentation of the GDI+ enumeration
- Enumerations – all the enumerations of the package
- Pen class