private void TopPanel_MouseMove(object sender, MouseEventArgs e) { if (isTopPanelDragged) { Point newPoint = TopPanel.PointToScreen(new Point(e.X, e.Y)); newPoint.Offset(offset); this.Location = newPoint; } }
private void TopPanel_MouseMove(object sender, MouseEventArgs e) { if (isTopPanelDragged) { Point newPoint = TopPanel.PointToScreen(new Point(e.X, e.Y)); newPoint.Offset(offset); this.Location = newPoint; if (this.Location.X > 2 || this.Location.Y > 2) { if (this.WindowState == FormWindowState.Maximized) { this.Location = _normalWindowLocation; } } } }
private void TopPanel_MouseMove(object sender, MouseEventArgs e) { if (isTopPanelDragged) { Point newPoint = TopPanel.PointToScreen(new Point(e.X, e.Y)); newPoint.Offset(offset); this.Location = newPoint; if (this.Location.X > 2 || this.Location.Y > 2) { if (this.WindowState == FormWindowState.Maximized) { this.Location = _normalWindowLocation; this.Size = _normalWindowSize; _MaxButton.CFormState = MinMaxButton.CustomFormState.Normal; isWindowMaximized = false; } } } }