please tell me how to make shapes with rounded edges (Winforms.) Found this code, but it has problems. when you drag a shape, it is bad draws. And some controls inside have problems with painting too.
[DllImport("Gdi32.dll")]
public static extern IntPtr CreateRoundRectRgn(int nLeftRect,
int nTopRect,
int nRightRect,
int nBottomRect,
int nWidthEllipse,
int nHeightEllipse);
[DllImport("user32.dll")]
public static extern int SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bRedraw);
/// <summary>
/// radius
/// </summary>
public int Radius = 0;
public AfyForm()
{
InitializeComponent();
min_max_closeEvents();
borderEvents();
}
min_max_closeEvents(); borderEvents(); - methods for border painting