private void OnEnabled(object sender, EventArgs e)
{
if ((_ribbonTextBox != null) && (_ribbonTextBox.Ribbon != null))
{
PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonTextBox)["Enabled"];
bool oldValue = (bool)propertyEnabled.GetValue(_ribbonTextBox);
bool newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonTextBox, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonTextBox, newValue);
}
}