Which frame was clicked

Post

Posted
Rating:
#1 (In Topic #2225)
Regular
bill-lancaster is in the usergroup ‘Regular’
I have generated a number of frames on a form.
How can I identfy which frame was clicked?

Any advice would be welcome
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by Yogi)
#2
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
gbWilly is in the usergroup ‘Blogger’
gbWilly is in the usergroup ‘GambOS Developer’

bill-lancaster said

I have generated a number of frames on a form.
How can I identify which frame was clicked?
If a control has no Click event (like a Frame) then code the MouseDown event.

If you use the Group property of all the Frames and set it to one and the same (I named it Frames) you can create one MouseDown event for all the Frames at once.
In it use Last (see here) to get the name of the Frame clicked.

Attached is a source archive to demonstrate it all (gambas 3.19.6).

Attachment

Frames-0.0.1.tar.gz



If on another Gambas version do a Compile all after opening the source code in IDE.
The project uses qt5, you can change that too if your system has no qt5

Enjoy and just ask if you need clarification :thumbs:


 

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- Wanna learn Gambas? - Guides overview
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by gbWilly)
#3
Regular
bill-lancaster is in the usergroup ‘Regular’
That's great thank you.
Online now: No Back to the top
1 guest and 0 members have just viewed this.