Winforms fixed single border on custom shaped control
- by JD
Hi all,
I have created a custom control inheriting from a panel in .NET 3.5
The panel has a custom polygon border, which comes from a pointF array (In diagram, control is highlighted yellow).
Fig 1 shows the control with BorderStyle none. Fig 2 with BorderStyle fixed-single
As shown in Fig 2, the border follows the Rectangle bounding the control. IS there a way to make the border follow the actual border of the control set by the polygon?
FYI the polygon is created using a GraphicsPath object.
Drawing the line with GDI+ does not work, as the control clips the line and it looks awful...
Fig1
Fig2