I have four ToolStripSplitButtons in a ToolStrip in one of my c# applications as shown here.

enter image description here

To open ToolStripMenuItem window I have to click on any of the four ToolStripSplitButtons. As opposed to it I only want to move my mouse(rather than clicking it) on any of the ToolStripSplitButtons and keep it there till ToolStripmenuItems Window appears. I guess I will need a MouseHover event for that but don't know how to do this. I would be thankfull to one who solves this problem.

有帮助吗?

解决方案

Something like this:

public Form1() {
  InitializeComponent();
  toolStripDropDownButton1.MouseEnter += toolStripDropDownButton1_MouseEnter;
}

void toolStripDropDownButton1_MouseEnter(object sender, EventArgs e) {
  toolStripDropDownButton1.ShowDropDown();
}

Or you can use the Hover event instead.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top