using System; using System.IO; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Diagnostics; using DarkControls; namespace DarkControls { public partial class BlankForm : Form { protected override CreateParams CreateParams { get { // Activate double buffering at the form level. All child controls will be double buffered as well. CreateParams cp = base.CreateParams; cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED return cp; } } public BlankForm() { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.None; this.Region = Region.FromHrgn(Utils.CreateRoundRectRgn(0, 0, Width, Height, 10, 10)); this.closeBtn.Region = Region.FromHrgn(Utils.CreateRoundRectRgn(0, 0, closeBtn.Width, closeBtn.Height, 10, 10)); } protected override void WndProc(ref Message m) { base.WndProc(ref m); if (m.Msg == Utils.WM_NCHITTEST) m.Result = (IntPtr)(Utils.HT_CAPTION); } } }