Button down issue
-
I am designing a PDA application using the .NET CF, but I guess this issue would be the same irrespective of it being .NET Framework or .NET Compact Framework.. I have a button and I want to make it have like a button-down event. For example, a form has a mousedown and when the mouse button is down, there is an eventhandler mousedown for it. I want my button to do the same. Note that the mousedown event doesn't exist for a button. Even setting a mousedown event on the form which contains the button doesn't do the trick (clicking the button does not fire the mousedown event of the form).. what I want to do is have a facility in my application like while the button is being pressed (for example it can remain pressed for 5 seconds), keep changing the value of another control.. Any help would be highly appreciated. Cheers, David
-
I am designing a PDA application using the .NET CF, but I guess this issue would be the same irrespective of it being .NET Framework or .NET Compact Framework.. I have a button and I want to make it have like a button-down event. For example, a form has a mousedown and when the mouse button is down, there is an eventhandler mousedown for it. I want my button to do the same. Note that the mousedown event doesn't exist for a button. Even setting a mousedown event on the form which contains the button doesn't do the trick (clicking the button does not fire the mousedown event of the form).. what I want to do is have a facility in my application like while the button is being pressed (for example it can remain pressed for 5 seconds), keep changing the value of another control.. Any help would be highly appreciated. Cheers, David
What if you use the mouse down event and check for the position of the cursor to be inside your button. Wouldn't that have the same outcome?
-
What if you use the mouse down event and check for the position of the cursor to be inside your button. Wouldn't that have the same outcome?
I thought of that too.. But it doesn't help.. because when you click the button, the mousedown event of the form doesn't get fired
-
I am designing a PDA application using the .NET CF, but I guess this issue would be the same irrespective of it being .NET Framework or .NET Compact Framework.. I have a button and I want to make it have like a button-down event. For example, a form has a mousedown and when the mouse button is down, there is an eventhandler mousedown for it. I want my button to do the same. Note that the mousedown event doesn't exist for a button. Even setting a mousedown event on the form which contains the button doesn't do the trick (clicking the button does not fire the mousedown event of the form).. what I want to do is have a facility in my application like while the button is being pressed (for example it can remain pressed for 5 seconds), keep changing the value of another control.. Any help would be highly appreciated. Cheers, David
What makes you think the
MouseDown
event doesn't exist for aButton
? According to the documentation, theMouseUp
andMouseDown
events are part of the Control class and supported in CF 1.0 and 2.0 as well. SinceButton
inherits fromControl
, these events do exist.Regards, mav -- Black holes are the places where God divided by 0...
-
What makes you think the
MouseDown
event doesn't exist for aButton
? According to the documentation, theMouseUp
andMouseDown
events are part of the Control class and supported in CF 1.0 and 2.0 as well. SinceButton
inherits fromControl
, these events do exist.Regards, mav -- Black holes are the places where God divided by 0...
Well.. I can't find them in the property window of the button. I have KeyDown, KeyUp and a bunch of other events but not MouseDown and MouseUp.