[skip ci] Added horizontal scrolling with the mousewheel when keeping shift pressed.

This commit is contained in:
Robin 2016-04-29 16:44:16 +02:00
commit 4f326c9c0e

View file

@ -32,5 +32,23 @@ namespace GreenshotPlugin.Controls {
// scrolling to the active control when the panel loses and regains focus
return DisplayRectangle.Location;
}
/// <summary>
/// Add horizontal scrolling to the panel, when using the wheel and the shift key is pressed
/// </summary>
/// <param name="e">MouseEventArgs</param>
protected override void OnMouseWheel(MouseEventArgs e)
{
if (VScroll && (ModifierKeys & Keys.Shift) == Keys.Shift)
{
VScroll = false;
base.OnMouseWheel(e);
VScroll = true;
}
else
{
base.OnMouseWheel(e);
}
}
}
}