protected virtual void Activate() { if (ActiveControl == this) { return; } if (ActiveControl != null) { ActiveControl.Deactivate(); } ActiveControl = this; }
protected virtual void OnEnabledChanged() { if (EnabledChanged != null) { EnabledChanged.Invoke(this, EventArgs.Empty); } if (!Enabled && ActiveControl == this) { ActiveControl.Deactivate(); } if (Controls != null) { for (int I = 0; I < Controls.Count; I++) { Controls[I].OnEnabledChanged(); } } }