I try to change the background color of a menu, but the program crashed when the menu item is a separator. I try to check to see if there is a separator before I make the change, but I cannot get the checking type to work
any hint on getting this to workPHP Code:foreach (ToolStripMenuItem item in items)
{
if (!item is ToolStripSeparator)
{
item.BackColor = color;
if (item.DropDownItems.Count > 0)
{
SetItemsBackColor(color, item.DropDownItems);
}
}
}




Reply With Quote