dedecting ctrl+mouseweel

  • Thread starter Thread starter Andrus
  • Start date Start date
A

Andrus

I need to detect Ctrl+MouseWheel press in WinForms RichTextBox control to
save changed font size.

In
protected override void OnMouseWheel(MouseEventArgs e)

MouseEventArgs does not allow to dedect Ctrl key holding.

How to discover in OnMouseWheel event that Ctrl key is hold down when mouse
wheel is rotated ?

Andrus.
 
I need to detect  Ctrl+MouseWheel press in WinForms RichTextBox controlto
save changed font size.

In
        protected override void OnMouseWheel(MouseEventArgs e)

MouseEventArgs does not allow to dedect Ctrl key holding.

How to discover in OnMouseWheel event that Ctrl key is hold down when mouse
wheel is  rotated ?

Andrus.

Use :

if (ModifierKeys == Keys.Control)
// do something...

Michel
 
Back
Top