Event handle for holding SHIFT while pressing a button on Winforms

I have the following event descriptor in my Visual Basic.NET design form (VS 2013).

I wanted to know if I can change it so that I can distinguish between a normal click and when someone holds the SHIFT button while pressing the button.

 Private Sub btnLLDoubleDip_Click(sender As Object, e As EventArgs) Handles btnLLDoubleDip.Click ' Double Dip is easy... ' Stop the timer ' Create a flag that this is now a double dip attempt, NO MORE WALK OUTS End Sub 
+4
source share
1 answer

You can use the ModifierKeys.HasFlag function to do this:

 If ModifierKeys.HasFlag(Keys.Shift) Then MessageBox.Show("Shift is pressed") Else MessageBox.Show("Shift is not pressed") End If 
+4
source

All Articles