private void loopmenuitems(ToolStripMenuItem item ,Color c, Color text)
{
item.BackColor = c;
item.ForeColor = text;
if (item.HasDropDownItems)
foreach (Object child in item.DropDownItems)
try
ToolStripMenuItem menuitem = (ToolStripMenuItem)child;
loopmenuitems(menuitem, c, text);
}
catch
ToolStripSeparator sep = (ToolStripSeparator)child;
sep.ForeColor = text;
sep.BackColor = c;
private void looopMenu(Color c, Color text)
//Doesn't WORK menuStrip1.BackColor = c;
menuStrip1.ForeColor = text;
foreach (Object m in menuStrip1.Items)
ToolStripMenuItem items = (ToolStripMenuItem)m;
loopmenuitems(items, c, text);
ToolStripSeparator sep = (ToolStripSeparator)m;
// WORKS popupmenu.BackColor = c;
popupmenu.ForeColor = text;
foreach (Object menuitem in popupmenu.Items) {
ToolStripMenuItem items = (ToolStripMenuItem)menuitem;
ToolStripSeparator sep = (ToolStripSeparator)menuitem;