Custom shape button

ThePuiu

Active Member
Licensed User
Longtime User
I want to make some buttons like the attached drawing. The buttons are attached to 5 ImageView. How can I simulate the press of a button? I need to move the ImageView and then restore it back? Looking for the easiest way to do this.

Thank you!
 

Attachments

  • complet.png
    complet.png
    13.1 KB · Views: 418

JesseW

Active Member
Licensed User
Longtime User
have you considered overlaying a transparent panel over each of the images? you could then catch the panel's click event, and even change te image underneath to simulate a button press. but since we code in a world of perfect rectangles, and your image rectangles overlap each other, be sure to do the center panel last, or use a .bringtofront method on it after the panels are all drawn.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I would do it with a single panel with the image on it.
In the Panel_Touch event you know the cursor coordinates and you can easily check in what area the cursor is and executue the correct function.

Best regards.
 
Upvote 0
Top