Define An Event From a Class

Post Reply
User avatar
Technopeasant
Posts: 18
Joined: Saturday 13th July 2019 6:50pm

Define An Event From a Class

Post by Technopeasant » Saturday 26th October 2019 5:34pm

I have a class file that inherits from picture box, and what I want to do is put code in the class file to account for the raising of the mouse down event.

http://gambaswiki.org/wiki/comp/gb.qt4/ ... .mousedown

I can do it from the form, but this is overly complicated for more than one instance. What I am wondering is if there is a way to define code for this event in the class file.

Here is pseudo code to show what I am looking for:

Code: Select all

Public Sub _MouseDown()

Me.Tag = "Clicked!"

End
Is this possible?
Technical director,
Piga Software
http://icculus.org/piga/

User avatar
cogier
Site Admin
Posts: 344
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Define An Event From a Class

Post by cogier » Sunday 27th October 2019 5:21pm

Have a look at the attached code. Let me know if this is what you wanted.
Task_Test_Working.tar.gz
(34.56 KiB) Downloaded 10 times

User avatar
Technopeasant
Posts: 18
Joined: Saturday 13th July 2019 6:50pm

Re: Define An Event From a Class

Post by Technopeasant » Tuesday 29th October 2019 3:19am

Not exactly what I was looking for, but interestingly almost exactly what I came up with upon further research.

Great minds thing alike.

:ugeek:

Your use of LAST is better than my solution though, which was to check which ones were triggering .Hovered, so thanks for that.
Technical director,
Piga Software
http://icculus.org/piga/

Post Reply