Skip to Content
.NET Windows® Forms Custom Controls
book

.NET Windows® Forms Custom Controls

by Richard Weeks
January 2002
Intermediate to advanced
288 pages
5h 48m
English
Sams
Content preview from .NET Windows® Forms Custom Controls

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro .NET 5 Custom Libraries: Implementing Custom .NET Data Types

Pro .NET 5 Custom Libraries: Implementing Custom .NET Data Types

Roger Villela
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner

Publisher Resources

ISBN: 0672323338Purchase book