Files
docs-desktop/dotnet-desktop-guide/framework/winforms/advanced/how-to-join-lines.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

2.3 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Join Lines 03/30/2017
csharp
vb
miter line join style
bevel line join style
line join
drawing [Windows Forms], joining lines
GraphicsPath object
round line join style
lines [Windows Forms], joining
graphics [Windows Forms], joining lines
9fc480c2-3c75-4fd1-8ab5-296a99e820e2

How to: Join Lines

A line join is the common area that is formed by two lines whose ends meet or overlap. GDI+ provides three line join styles: miter, bevel, and round. Line join style is a property of the xref:System.Drawing.Pen class. When you specify a line join style for a xref:System.Drawing.Pen object, that join style will be applied to all the connected lines in any xref:System.Drawing.Drawing2D.GraphicsPath object drawn using that pen.

The following illustration shows the results of the beveled line join example.

Illustration that shows joined lines.

Example

You can specify the line join style by using the xref:System.Drawing.Pen.LineJoin%2A property of the xref:System.Drawing.Pen class. The example demonstrates a beveled line join between a horizontal line and a vertical line. In the following code, the value xref:System.Drawing.Drawing2D.LineJoin.Bevel assigned to the xref:System.Drawing.Pen.LineJoin%2A property is a member of the xref:System.Drawing.Drawing2D.LineJoin enumeration. The other members of the xref:System.Drawing.Drawing2D.LineJoin enumeration are xref:System.Drawing.Drawing2D.LineJoin.Miter and xref:System.Drawing.Drawing2D.LineJoin.Round.

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

Compiling the Code

The preceding example is designed for use with Windows Forms, and it requires xref:System.Windows.Forms.PaintEventArgs e, which is a parameter of the xref:System.Windows.Forms.Control.Paint event handler.

See also