protected override void OnClick (EventArgs e)
{
if (!this.Enabled)
return;
if (this.HasDropDownItems) {
base.OnClick (e);
return;
}
if (this.OwnerItem is ToolStripDropDownItem)
(this.OwnerItem as ToolStripDropDownItem).OnDropDownItemClicked (new ToolStripItemClickedEventArgs (this));
if (this.IsOnDropDown) {
ToolStrip ts = this.GetTopLevelToolStrip ();
if (ts != null)
ts.Dismiss (ToolStripDropDownCloseReason.ItemClicked);
}
if (this.IsMdiWindowListEntry) {
this.mdi_client_form.MdiParent.MdiContainer.ActivateChild (this.mdi_client_form);
return;
}
if (this.check_on_click)
this.Checked = !this.Checked;
base.OnClick (e);
if (!this.IsOnDropDown && !this.HasDropDownItems) {
ToolStrip ts = this.GetTopLevelToolStrip ();
if (ts != null)
ts.Dismiss (ToolStripDropDownCloseReason.ItemClicked);
}
}