Do something while the mouse button is down
-
Hi, In windows application - I want the user to press a button and while the button is pressed I will do something... I tryed the mouse down event but it only doing it once and I want to do the same function as long as the button is pressed (or the mouse button is down) Thanks
dana Tov
-
Hi, In windows application - I want the user to press a button and while the button is pressed I will do something... I tryed the mouse down event but it only doing it once and I want to do the same function as long as the button is pressed (or the mouse button is down) Thanks
dana Tov
On the mouse down event start a new thread that does the work. On the mouse up event signal the other thread to stop working.
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." Ready to Give up - Your help will be much appreciated. My website
-
Hi, In windows application - I want the user to press a button and while the button is pressed I will do something... I tryed the mouse down event but it only doing it once and I want to do the same function as long as the button is pressed (or the mouse button is down) Thanks
dana Tov
-
Hi, In windows application - I want the user to press a button and while the button is pressed I will do something... I tryed the mouse down event but it only doing it once and I want to do the same function as long as the button is pressed (or the mouse button is down) Thanks
dana Tov
Hi, a keyboard key has autorepeat, so it will generate multiple KeyDown and KeyPressed events when you hold the key down. A mouse button does not. If you need a repeat for the mouse button (or a faster repeat for a keyboard key) you can use a Forms.Timer that runs all the time, and checks whether the ccndition is satisfied (either key is down or mouse button is down). For "key is down", set a variable lastKey to the key that is down in KeyDown, and set it to Keys.None in KeyUp; for "mouse is down" use Control.MouseButtons (there also is Control.ModifierKeys for CTRL/ALT/SHIFT). :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Hi, In windows application - I want the user to press a button and while the button is pressed I will do something... I tryed the mouse down event but it only doing it once and I want to do the same function as long as the button is pressed (or the mouse button is down) Thanks
dana Tov
-
Mouse down is a single thread event -TRUE But you can use multi threading in it. start a thread on mouse down and stop it on mouse up
-
i am sorry!! i didn't see that Mr. Martin. but it seems you are quite good in peeping other's reply
-
sam# wrote:
i didn't see that
I assumed that. I forgot to mark it as "Joke"
sam# wrote:
Mr. Martin
Come on! :(
sam# wrote:
but it seems you are quite good in peeping other's reply
Really???
:-D
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Hi, In windows application - I want the user to press a button and while the button is pressed I will do something... I tryed the mouse down event but it only doing it once and I want to do the same function as long as the button is pressed (or the mouse button is down) Thanks
dana Tov
you can do it using two events: 1. when mouse down 2. when mouse get off the button range in step #1, you know that the mouse is down. in step #2 you know that the mouse left the button, then you can stop the thread you started in the first event!:):):):)