C# 2.0 Key + Mouse Move
-
Control.ModifierKeys
-
Control.ModifierKeys
Thank you! that worked.. before your response I found a few crazy methods of importing user32.dll etc. This is exactly what I was hoping for. I am a bit confused as to how it works.. what is Control ? the current control in focus? I was expecting using sender or e to find the data.
if (Control.ModifierKeys == Keys.Shift) { ......... }
-
Thank you! that worked.. before your response I found a few crazy methods of importing user32.dll etc. This is exactly what I was hoping for. I am a bit confused as to how it works.. what is Control ? the current control in focus? I was expecting using sender or e to find the data.
if (Control.ModifierKeys == Keys.Shift) { ......... }
ModifierKeys is a static property - which just calls the Win32 API "GetKeyState". This doesn't require any state information (like 'sender' or 'e') - and can basically be called from anywhere at any time.