Пример #1
0
        public void SetBorderCurve(int radius)
        {
            Region r = Region;

            if (r != null)
            {
                r.Dispose();
            }
            IntPtr toBeDestroyed = CreateRoundRectRgn(0, 0, Width, Height, radius, radius);

            Region = Region.FromHrgn(toBeDestroyed);
            MainLauncher.DeleteObject(toBeDestroyed);
        }
Пример #2
0
        public static void SetBorderCurve(int radius, Control ctrl)
        {
            Region r = ctrl.Region;

            if (r != null)
            {
                r.Dispose();
            }
            IntPtr toBeDestroyed = CreateRoundRectRgn(0, 0, ctrl.Width, ctrl.Height, radius, radius);

            r           = Region.FromHrgn(toBeDestroyed);
            ctrl.Region = r;
            MainLauncher.DeleteObject(toBeDestroyed);
            return;
        }