Both screenshots are taken from Windows Explorer on Windows 10.
In Winforms, is there a way to force the submenu behavior shown in the first screen capture?
In this more forgiving mode, when the submenu is visible, diagonal mouse movements that happen to briefly cross over other menu items do not penalize the user and it is easy to hit the target submenu item.
[]
I want to avoid this behavior, where diagonal movements do penalize the user and it is difficult to hit the target submenu item.
[]
This is somewhat difficult to Google because there aren't really concrete terms for this. I tried searches like "forgiving" "grace period" "delay" "diagonal" etc. and couldn't find anything worthwhile.
If you use MenuStrip, the default behavior is much better and you also can tune the show/hide delay to give more time to the user to move the cursor.
The default delay is coming from SystemInformation.MenuShowDelay which is coming from a system-wide setting and I assume you don't want to change that setting.
There's an internal MenuTimer which controls the show/hide delay. You can change the interval of the timer like this:
private void Form1_Load(object sender, EventArgs e)
{
var menuTimer= typeof(ToolStripMenuItem).GetField("menuTimer",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static)
.GetValue(null);
menuTimer.GetType().GetField("slowShow",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
.SetValue(menuTimer, 1000);
}
And the user will have more time before the submenu closes automatically: