|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Draw a Line with Line Caps
You can draw the start or end of a line in one of several shapes called line caps. GDI+ supports several line caps, such as round, square, diamond, and arrowhead.
You can specify line caps for the start of a line (start cap), the end of a line (end cap), or the dashes of a dashed line (dash cap).
The following example draws a line with an arrowhead at one end and a round cap at the other end. The illustration shows the resulting line:
Compiling the Code
Create a Windows Form and handle the form's e as .event. Paste the example code into the Paint event handler passing