I have some menus that contain many menuitems. Mouse wheel doesn\'t scroll them. I have to use the keyboard arrows or click the arrows at top and bottom. Is it possible to u
This is very simply using a submenu (ToolStripMenuItem
) of the context menu :
Assuming using a form1
(or UserControl
) and a contextMenuStrip1
:
private void form1_Load( object sender , EventArgs e )
{
//this.MouseWheel -= When_MouseWheel;
this.MouseWheel += When_MouseWheel;
}
void When_MouseWheel( object sender , MouseEventArgs e )
{
if ( this.contextMenuStrip1.IsDropDown ) {
//this.Focus();
if ( e.Delta > 0 ) SendKeys.SendWait( "{UP}" );
else SendKeys.SendWait( "{DOWN}" );
}
}