protected override void OnPaintBackground(PaintEventArgs e) { base.OnPaintBackground(e); if (LayouKind.DwmIsCompositionEnabled()) { e.Graphics.Clear(Color.White); } }
protected override void OnLoad(EventArgs e) { if (LayouKind.DwmIsCompositionEnabled()) { MARGINS margin = new MARGINS(); margin.Right = margin.Left = margin.Bottom = margin.Top = -1; LayouKind.DwmExtendFrameIntoClientArea(this.Handle, ref margin); } base.OnLoad(e); }