1

How to detect more than 1 moddifier keys? (Alt & Ctrl)?

I have this working code:

Private Sub PictureBox1_MouseWheel(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseWheel
    If ModifierKeys = Keys.Control Then
        If e.Delta <> 0 Then
            PictureBox1.Width += CInt(PictureBox1.Width * e.Delta / 1000)
            PictureBox1.Height += CInt(PictureBox1.Height * e.Delta / 1000)
        end if
     end if
end sub

if i change it into:
If ModifierKeys = (Keys.Control Or Keys.Alt) Then stop working. How can i detect both keys, but not combined?

arc95
  • 97
  • 1
  • 8

1 Answers1

2
If ModifierKeys = Keys.Control OrElse ModifierKeys = Keys.Alt Then

That really should have been obvious.

jmcilhinney
  • 50,448
  • 5
  • 26
  • 46