but i want that if curosor hovers a button for 3 seconds then then it should perform click event.
I have tried a timer but i am unable to stop a timer so timer does not seems working in this case.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 29, 2013, 5:19 PM
So that will be:
1. In timer1_Tick when counter == 3; and
2. In button1_MouseLeave.
Posted Aug 29, 2013, 4:07 PM
1)when counter=3,button clicked,timer stopped
bt still counter increments (means timer1_tick_1 still called )why??
VulpesPosted Aug 29, 2013, 3:35 PM
The former is a form level variable but the latter is a local variable.
If I were you, I'd create the timer just once at form level (if you've added it using the VS designer this will have been done automatically) and then just start it and stop it as required.
Notice that you need to allow for SystemInfomation.MouseHoverTime because the mouse will have been hovering over the button for this amount of time before the MouseHover event is fired.
Posted Aug 29, 2013, 2:49 PM
VulpesPosted Aug 28, 2013, 6:05 PM