I don't want to use the mouseup event because I want to allow the user to drag outside the control. I need to check the state via a timer. I vaguely remember doing this before at some point by using
If MouseButtons = MouseButtons.Left Then...
But now it says that MouseButtons is a type and cannot be used as an expression (which is true, its an enum type).
Maybe they changed things or maybe I just remember wrong.. either way, how would I check if the button is still down?
This is tried and tested. I created a new class: testmouseclass and created a shared function you can use anytime to determine if the
LeftMouseButton
is down. This is possible with the help ofGetAsyncKeyState
call.Example Usage
Depending on the timer tick's this can be a headache as well. Not sure how you are using this, but in my example I had the timer at 3 seconds and when I held the
LeftMouseButton
down a message popped up and when I clicked it again it popped up again because of the timer and the left mouse was down. Also this work's even outside of your application...