/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void maximizeBtn_Click(object sender, EventArgs e) { IsMaximizeCalled = true; if (this.CurrentWindowsState == MenWindowsState.Maximized && !IsMinimize) { this.CurrentWindowsState = MenWindowsState.Normal; this.ParentForm.Size = this.OldSize; if (!(OldLocation == new Point(0, 0))) { this.ParentForm.Location = OldLocation; } else { var rectangle = Screen.FromControl(this).Bounds; this.ParentForm.Location = new Point((rectangle.Width - OldSize.Width) / 2, (rectangle.Height - OldSize.Height) / 2); } this.maximizeBtn.Image = global::Menporul.Windows.Controls.MenResource.maximize; } else { IsMinimize = false; CurrentWindowsState = MenWindowsState.Maximized; var curWork = this.CurrentCursorWorkingArea; this.ParentForm.Location = new Point(curWork.X, curWork.Y); this.ParentForm.Size = new Size(curWork.Width, curWork.Height); this.maximizeBtn.Image = global::Menporul.Windows.Controls.MenResource.restore; } }
/// <summary> /// /// </summary> public MenTitlebar() { InitializeComponent(); this.minimizeBtn.Visible = _enableMinMax; this.maximizeBtn.Visible = _enableMinMax; formToolTip = new MenToolTip(); CurrentWindowsState = MenWindowsState.Normal; ColorInitialize(); }