using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Work.Helper { public class WindowStyle { public static void SetFormRoundRectRgn(Control c, int rgnRadius) { int hRgn = 0; hRgn = Win32.CreateRoundRectRgn(0, 0, c.Width + 1, c.Height + 1, rgnRadius, rgnRadius); Win32.SetWindowRgn(c.Handle, hRgn, true); Win32.DeleteObject(hRgn); } } }