/// <summary> /// Extends the frame into client. /// </summary> private void ExtendFrameIntoClient() { margin.CxLeftWidth = X; margin.CxRightWidth = Width; margin.CyBottomHeight = Height; margin.CyTopHeight = Y; NativeUtils.DwmExtendFrameIntoClientArea(Handle, ref margin); }