Basically let’s say I’m making a simple counter, when I click the mouse, the counter goes up. My question is how do I program an even that makes it possible for me to have the counter flowing while the mouse I held down, basically something that works exactly as the KeyPress event handler, only with a mouse.
Share
If you don’t need a timer running for some other reason, I wouldn’t use a timer. I would use a class property or global variable, depending on what you’re doing.
When you fire the MouseDown event:
startTicks = DateTime.Now.Ticks;On the MouseUp event, take the difference and convert it to whatever time element (min, sec, hour) you want.