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

OnClick() protected method

Raises the CheckStateChanged event.
protected OnClick ( EventArgs e ) : void
e System.EventArgs An EventArgs containing the event data.
return void
        protected override void OnClick(EventArgs e)
        {
            if (AutoCheck)
            {
                // Change state based on the current state
                switch (CheckState)
                {
                    case CheckState.Unchecked:
                        CheckState = CheckState.Checked;
                        break;
                    case CheckState.Checked:
                        CheckState = (ThreeState ? CheckState.Indeterminate : CheckState.Unchecked);
                        break;
                    case CheckState.Indeterminate:
                        CheckState = CheckState.Unchecked;
                        break;
                }
            }

            base.OnClick(e);

            // If we have an attached command then execute it
            if (KryptonCommand != null)
                KryptonCommand.PerformExecute();
        }