📜  将工具条项填充到组合框 - C# 代码示例

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

代码示例1
item1ToolStripMenuItem.Click += new System.EventHandler(ToolStripMenuItem_Click);
item2ToolStripMenuItem.Click += new System.EventHandler(ToolStripMenuItem_Click);
item3ToolStripMenuItem.Click += new System.EventHandler(ToolStripMenuItem_Click);

private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
  comboBox1.SelectedIndex = comboBox1.FindString(((ToolStripMenuItem)sender).Text);
}