, .
override protected void OnItemClicked(ToolStripItemClickedEventArgs e)
{
if (this.Items.Count == 0)
base.OnItemClicked(e);
}
ContextMenu OnItemClicked, onPopup. , ContextMenu
public class MyContextMenu : ContextMenu
{
override protected void OnPopUp(EventArgs e)
{
if (this.MenuItems.Count == 0)
base.OnPopUp(e);
}
}
, show
public class MyContextMenu : ContextMenu
{
override protected void Show (Control c, Point p)
{
if (this.MenuItems.Count == 0)
base.Show (c, p) ;
}
override protected void (Control c, Point p, LeftRightAlignment z)
{
if (this.MenuItems.Count == 0)
base.Show (c, p, z) ;
}
}