当我在C#中从一个选定的下拉按钮移动到另一个下拉按钮时,如何设置自动下拉按钮?

当我在C#中从一个选定的下拉按钮移动到另一个下拉按钮时,如何设置自动下拉按钮?,c#,winforms,C#,Winforms,我曾尝试在C#windown格式的statusStrip中创建几个下拉按钮。 这是正常的,当我只是移动光标到按钮,它不会下拉项目,它只下拉项目,只有当我点击下拉按钮 但是,问题是在我单击了DropDownButton1之后,它会下拉项目,但是当我将光标移动到另一个DropDownButton2时,DropDownButton2的项目将不会下拉!! 单击下拉按钮1后移动鼠标时,如何设置下拉按钮2的项目自动下拉?就像一般的应用程序一样 谢谢大家 您可以使用该属性, 在事件中将其设置为true尝试以下

我曾尝试在C#windown格式的statusStrip中创建几个下拉按钮。 这是正常的,当我只是移动光标到按钮,它不会下拉项目,它只下拉项目,只有当我点击下拉按钮

但是,问题是在我单击了
DropDownButton1
之后,它会下拉项目,但是当我将光标移动到另一个
DropDownButton2
时,
DropDownButton2
的项目将不会下拉!! 单击
下拉按钮1
后移动鼠标时,如何设置
下拉按钮2
的项目自动下拉?就像一般的应用程序一样

谢谢大家

您可以使用该属性,
在事件中将其设置为true

尝试以下操作:

this.dropDown1.MouseHover += new System.EventHandler(this.dropDown1_MouseHover);



private void dropDown1_MouseHover(object sender, System.EventArgs e) 
{
    //Set the dropdown1 to dropped
    dropDown1.DroppedDown = true; 

    //Set the other dropdown to undropped
    dropDown2.DroppedDown = false;

}

有关更多信息,请添加更多代码

我们可以看一些代码吗?请添加一个最小的示例。请看:对不起,我没有尝试任何代码,我只是使用设计视图创建并添加DropDownButton&items。。