Hi,
I am trying to create a small Winform with some round edges (all 4 corners).
I got some code from the internet
But, the above code is not working as expected. This code only round the top upper corners and the right upper corner is not so perfectly rounded (have some pixel effect). The bottoms are not able to round either.
As I try to maximize the window is not able to maximize with its full length (working without this round edge code).
I have searched for the solution over the internet but didn't any other method or solution for this issue.
What I have tried:
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn
(
int nLeftRect,
int nTopRect,
int nRightRect,
int nBottomRect,
int nWidthEllipse,
int nHeightEllipse
);
if (isCustomTitle)
{
this.FormBorderStyle = FormBorderStyle.None;
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
}