c# 当我使用其中一个(不可编辑)下拉菜单时,怎么设置其它(不可编辑)下拉菜单他文本为空?

来源:百度知道 编辑:UC知道 时间:2024/06/04 14:01:38
我的下拉菜单内容是从数据库中提取填充的。

private void toolStripMenuItem1_DropDownOpening(object sender, EventArgs e)
{
foreach (ToolStripMenuItem tm in this.toolStripMenuItem1.DropDownItems)
{
tm.Enabled = false;
//tm.Text = "";
}
}

在使用的那个控件的OnClick事件里面写
其他控件ID.items.clear();
那控件忘了叫啥名字了

下拉列表.Text=null;