/// <summary>The OnMaximizeClick.</summary> /// <param name="sender">The sender.</param> /// <param name="e">The event args.</param> protected virtual void OnMaximizeClick(object sender, EventArgs e) { if (ParentForm.WindowState == FormWindowState.Normal) { if (_maximizeButton.BoxType == ControlBoxButton.ControlBoxType.Default) { _maximizeButton.Text = @"2"; } ParentForm.WindowState = FormWindowState.Maximized; MaximizeClick?.Invoke(new ControlBoxEventArgs(ParentForm)); } else { if (_maximizeButton.BoxType == ControlBoxButton.ControlBoxType.Default) { _maximizeButton.Text = @"1"; } ParentForm.WindowState = FormWindowState.Normal; RestoredFormWindow?.Invoke(new ControlBoxEventArgs(ParentForm)); } }
/// <summary>The maximize button click.</summary> /// <param name="sender">The sender.</param> /// <param name="e">The event args.</param> protected virtual void OnMaximizeClick(object sender, EventArgs e) { MaximizeClick?.Invoke(new ControlBoxEventArgs(ParentForm)); ToggleWindowState(null); }