ComponentFactory.Krypton.Toolkit.ButtonSpecFormWindowMin.OnClick C# (CSharp) Method

OnClick() protected method

Raises the Click event.
protected OnClick ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void
        protected override void OnClick(EventArgs e)
        {
            // Only if associated view is enabled to we perform an action
            if (GetViewEnabled())
            {
                // If we do not provide an inert form
                if (!KryptonForm.InertForm)
                {
                    // Only if the mouse is still within the button bounds do we perform action
                    MouseEventArgs mea = (MouseEventArgs)e;
                    if (GetView().ClientRectangle.Contains(mea.Location))
                    {
                        // Toggle between minimized and restored
                        if (KryptonForm.WindowState == FormWindowState.Minimized)
                            KryptonForm.SendSysCommand(PI.SC_RESTORE);
                        else
                            KryptonForm.SendSysCommand(PI.SC_MINIMIZE);

                        // Let base class fire any other attached events
                        base.OnClick(e);
                    }
                }
            }
        }