Button DOWN and Button UP

Bill Norris

Active Member
Licensed User
Longtime User
When a button is down, I want a label to become visible as long as the button is held down, then disappear when the button comes up. What is happening, though is that the label appears briefly then disappears, even though button is still down. I set a break point on the button_up procedure to observe the execution, and to my surprise it is firing even though my finger is still holding down the button. Any suggestions?

Thanks in advance
 

Bill Norris

Active Member
Licensed User
Longtime User
Ok, I answered my own question. I changed things around so that the labels becomes visible via the button_down event, and then set the label.visible=false in the button_click event. The button_down event fires first, and the click_event doesn't fire until you take your finger off the button.
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
When a button is down, I want a label to become visible as long as the button is held down, then disappear when the button comes up. What is happening, though is that the label appears briefly then disappears, even though button is still down. I set a break point on the button_up procedure to observe the execution, and to my surprise it is firing even though my finger is still holding down the button. Any suggestions?

I uploaded code for a custom keyboard and part of that was getting the Backspace key to continue deleting characters as long as the key is held down.

The btnBackspace_Down sub enables a timer to do the work and the _Up sub disables the timer. If the _Up sub was executing while the button was still down, the continuing backspace wouldn't work, but it DOES work, so I think that something else is going on in your code.

Maybe Erel can shed more light on this.
 
Upvote 0
Top