Page 1 of 1

Define An Event From a Class

Posted: Saturday 26th October 2019 5:34pm
by Technopeasant
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?

Re: Define An Event From a Class

Posted: Sunday 27th October 2019 5:21pm
by cogier
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 336 times

Re: Define An Event From a Class

Posted: Tuesday 29th October 2019 3:19am
by Technopeasant
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.