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