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