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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Aug 28, 2013, 2:05 PM EDT
Posted Aug 29, 2013, 10:49 AM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 29, 2013, 11:35 AM EDT
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, 12:07 PM EDT
1)when counter=3,button clicked,timer stopped
bt still counter increments (means timer1_tick_1 still called )why??
VulpesRank #55 · 29.2K reputationPosted Aug 29, 2013, 1:19 PM EDT
So that will be:
1. In timer1_Tick when counter == 3; and
2. In button1_MouseLeave.