Files
docs-desktop/dotnet-desktop-guide/framework/winforms/advanced/how-to-draw-a-line-with-line-caps.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

1.8 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Draw a Line with Line Caps 03/30/2017
csharp
vb
drawing [Windows Forms], lines
lines [Windows Forms], drawing
pens [Windows Forms], drawing lines
drawing lines [Windows Forms], line caps
eb68c3e1-c400-4886-8a04-76978a429cb6

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.

Example

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:

Illustration that shows a line with a round cap.

[!code-csharpSystem.Drawing.UsingAPen#71] [!code-vbSystem.Drawing.UsingAPen#71]

Compiling the Code

See also