当光标在ToolStrip中移开时,DropS在ToolStripDropDownButton中关闭 [英] Dropdown closes in ToolStripDropDownButton when cursor moves away in ToolStrip
问题描述
大家好,
在ToolStrip中,当光标移动到另一个控件时,ToolStripDropDownButton的下拉菜单会自动关闭。但在MS Word中,除非选择了另一个控件,否则Dropdown会保持打开状态。除非我选择
其他控件,否则我想保持Dropdown打开。我附上了示例和视频来演示问题,有人可以帮助我在普通的ToolStrip中实现MS Word的ToolStripDropDownButton的行为吗?
In ToolStrip, Dropdown of ToolStripDropDownButton closes automatically when cursor is moved to another control. But in MS Word, Dropdown keeps opened unless another control has been selected. I want to keep the Dropdown open unless i have selected the other control. I have attached the sample and video to demonstrate the problem, Can anyone helps me to achieve the behavior of ToolStripDropDownButton of MS Word in normal ToolStrip?
示例: ToolStripSample
视频: ToolStrip_Video
问候,
Keerthana J
Keerthana J
推荐答案
您好Keethana Jagannathan,
Hi Keethana Jagannathan,
感谢您在此发帖。
对于您的问题,请尝试以下代码。
For your question, please try the following code.
public Form1()
{
InitializeComponent();
this.toolStripDropDownButton1.DropDown.AutoClose = false;
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
toolStripDropDownButton1.DropDown.Close();
}
最好的问候,
Wendy
这篇关于当光标在ToolStrip中移开时,DropS在ToolStripDropDownButton中关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!