Button Events question

mjtaryan

Active Member
Licensed User
Longtime User
If I were to use, for different purposes, all four events (down, up, click, long-click) with a button AND use a single event handling routine, how do I distinguish between the four events (I'm thinking of something along the lines of "Activity.Action_Down", etc.)? Thanks.
 

mjtaryan

Active Member
Licensed User
Longtime User
Are you manually delegating the event to a single sub? You can pass an additional parameter to this sub to distinguish between the events.

Consider using a (transparent) Panel is you want to handle the Touch event.

Thanks Erel,

For the current project, I don't need the touch event (at least not as the UI is currently constructed). Can you provide a link to an example of using the parameter to distinguish between down, up, click, etc. Right now I have separate event handlers for each of these. Because a significant amount of the processing is quite similar, I'd like to make it more elegant and smaller. There are numerous buttons. Also, other than using the Tag property, is there a way to determine which button has been "activated"? Thanks.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
create a sub that will do everything you want give parameter of Action as string. then in each separate event call the sub passing "up", "down", etc
 
Upvote 0
Top