📜  循环菜单栏按钮 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:54.746000             🧑  作者: Mango

代码示例1
foreach (ToolStripMenuItem item in menuStrip1.Items)
            {
                item.ForeColor = Color.Red;
                item.BackColor = Color.Blue;
                foreach (ToolStripMenuItem children in item.DropDownItems)
                {
                    children.ForeColor = Color.Red;
                    children.BackColor = Color.Blue;
                }
            }