Pens

Pens are used for all drawing methods of the Graphics object with the exception of the DrawString method. A pen can be used to draw solid lines, dash patterns, and even brush-style lines such as gradient or hatch. To create brush-style pens, use the property Pen constructor for a new pen, or assign the existing brush to the pen's Brush property.

Figure 4.5 shows the interface for the Pen Demo. The property grid allows for changing the properties of the current pen to see the result.

Figure 4.5. The Pen Demo.

Unfortunately, pens are not very exciting and a lengthy explanation of their use is not necessary. However, the Pen Demo is interesting ...

Get .NET Windows® Forms Custom Controls now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.