private void Resizers_MouseDown(object sender, MouseEventArgs e) { if (!this._ResizeEnabled) { return; } Control SenderAsControl = sender as Control; this._OperationIndex = Convert.ToInt32(SenderAsControl.Tag); this._MouseLocation = new Point(e.X, e.Y); this._LocationDifference = new Point(); this._SizeDifference = new Point(); this._AppliedLocationDifference = new Point(); this._ActiveResizeDisplayForm = new ResizeDisplayForm(); this._ActiveResizeDisplayForm.Location = this._Parent.Location; this._ActiveResizeDisplayForm.Size = this._Parent.Size; this._ActiveResizeDisplayForm.Show(); }
private void TitleLabel_MouseDown(object sender, MouseEventArgs e) { if (this._Parent == null) { this._Parent = this.Parent; } DockContent ParentAsDockContent = this._Parent as DockContent; Form ParentAsForm = this._Parent as Form; if (ParentAsDockContent != null && ParentAsDockContent.DockPanel != null) { if (ParentAsDockContent.DockHandler.Pane != null) { if (ParentAsDockContent.DockHandler.Pane.FloatWindow.WindowState == FormWindowState.Maximized) { ParentAsDockContent.DockHandler.Pane.FloatWindow.WindowState = FormWindowState.Normal; ParentAsDockContent.DockHandler.Pane.FloatWindow.Location = new Point(e.X - ParentAsDockContent.DockHandler.Pane.FloatWindow.Width / 2, 0); this.WindowStateChange.Invoke(this, FormWindowState.Normal); Maximise.BackgroundImage = global::TakeOne.WindowSuite.Properties.Resources.Maximize; _Start.X = _Current.X = ParentAsDockContent.DockHandler.Pane.FloatWindow.Width / 2; _Start.Y = _Current.Y = e.Y + 10; } else { _Start.X = _Current.X = e.X; _Start.Y = _Current.Y = e.Y; } } else { if (ParentAsDockContent.WindowState == FormWindowState.Maximized) { ParentAsDockContent.WindowState = FormWindowState.Normal; ParentAsDockContent.Location = new Point(e.X - ParentAsDockContent.DockHandler.Pane.FloatWindow.Width / 2, 0); this.WindowStateChange.Invoke(this, FormWindowState.Normal); Maximise.BackgroundImage = global::TakeOne.WindowSuite.Properties.Resources.Maximize; _Start.X = _Current.X = ParentAsDockContent.Width / 2; _Start.Y = _Current.Y = e.Y + 10; } else { _Start.X = _Current.X = e.X; _Start.Y = _Current.Y = e.Y; } } this._Move = true; } else if (ParentAsForm != null) { if (ParentAsForm.WindowState == FormWindowState.Maximized) { ParentAsForm.WindowState = FormWindowState.Normal; ParentAsForm.Location = new Point(e.X, 0); this.WindowStateChange.Invoke(this, FormWindowState.Normal); Maximise.BackgroundImage = global::TakeOne.WindowSuite.Properties.Resources.Maximize; _Start.X = _Current.X = ParentAsForm.Width / 2; _Start.Y = _Current.Y = e.Y + 10; this._ActiveResizeDisplayForm = new ResizeDisplayForm(); this._ActiveResizeDisplayForm.Location = this._Parent.Location; this._ActiveResizeDisplayForm.Size = this._Parent.Size; } else { _Start.X = _Current.X = e.X; _Start.Y = _Current.Y = e.Y; this._ActiveResizeDisplayForm = new ResizeDisplayForm(); this._ActiveResizeDisplayForm.Location = this._Parent.Location; this._ActiveResizeDisplayForm.Size = this._Parent.Size; } this._Move = true; } else { } }
private void TitleLabel_MouseDown(object sender, MouseEventArgs e) { if (this._Parent == null) this._Parent = this.Parent; DockContent ParentAsDockContent = this._Parent as DockContent; Form ParentAsForm = this._Parent as Form; if (ParentAsDockContent != null && ParentAsDockContent.DockPanel != null) { if (ParentAsDockContent.DockHandler.Pane != null) { if (ParentAsDockContent.DockHandler.Pane.FloatWindow.WindowState == FormWindowState.Maximized) { ParentAsDockContent.DockHandler.Pane.FloatWindow.WindowState = FormWindowState.Normal; ParentAsDockContent.DockHandler.Pane.FloatWindow.Location = new Point(e.X - ParentAsDockContent.DockHandler.Pane.FloatWindow.Width/2, 0); this.WindowStateChange.Invoke(this, FormWindowState.Normal); Maximise.BackgroundImage = global::TakeOne.WindowSuite.Properties.Resources.Maximize; _Start.X = _Current.X = ParentAsDockContent.DockHandler.Pane.FloatWindow.Width / 2; _Start.Y = _Current.Y = e.Y + 10; } else { _Start.X = _Current.X = e.X; _Start.Y = _Current.Y = e.Y; } } else { if (ParentAsDockContent.WindowState == FormWindowState.Maximized) { ParentAsDockContent.WindowState = FormWindowState.Normal; ParentAsDockContent.Location = new Point(e.X - ParentAsDockContent.DockHandler.Pane.FloatWindow.Width / 2, 0); this.WindowStateChange.Invoke(this, FormWindowState.Normal); Maximise.BackgroundImage = global::TakeOne.WindowSuite.Properties.Resources.Maximize; _Start.X = _Current.X = ParentAsDockContent.Width / 2; _Start.Y = _Current.Y = e.Y + 10; } else { _Start.X = _Current.X = e.X; _Start.Y = _Current.Y = e.Y; } } this._Move = true; } else if (ParentAsForm != null) { if (ParentAsForm.WindowState == FormWindowState.Maximized) { ParentAsForm.WindowState = FormWindowState.Normal; ParentAsForm.Location = new Point(e.X, 0); this.WindowStateChange.Invoke(this, FormWindowState.Normal); Maximise.BackgroundImage = global::TakeOne.WindowSuite.Properties.Resources.Maximize; _Start.X = _Current.X = ParentAsForm.Width / 2; _Start.Y = _Current.Y = e.Y + 10; this._ActiveResizeDisplayForm = new ResizeDisplayForm(); this._ActiveResizeDisplayForm.Location = this._Parent.Location; this._ActiveResizeDisplayForm.Size = this._Parent.Size; } else { _Start.X = _Current.X = e.X; _Start.Y = _Current.Y = e.Y; this._ActiveResizeDisplayForm = new ResizeDisplayForm(); this._ActiveResizeDisplayForm.Location = this._Parent.Location; this._ActiveResizeDisplayForm.Size = this._Parent.Size; } this._Move = true; } else { } }
private void Resizers_MouseDown(object sender, MouseEventArgs e) { if (!this._ResizeEnabled) return; Control SenderAsControl = sender as Control; this._OperationIndex = Convert.ToInt32(SenderAsControl.Tag); this._MouseLocation = new Point(e.X, e.Y); this._LocationDifference = new Point(); this._SizeDifference = new Point(); this._AppliedLocationDifference = new Point(); this._ActiveResizeDisplayForm = new ResizeDisplayForm(); this._ActiveResizeDisplayForm.Location = this._Parent.Location; this._ActiveResizeDisplayForm.Size = this._Parent.Size; this._ActiveResizeDisplayForm.Show(); }