how to open ToolStripMenuItem Window by moving mouse on ToolStripSplitButton

StackOverflow https://stackoverflow.com/questions/15625034

  •  29-03-2022
  •  | 
  •  

Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top