Define An Event From a Class

Post

Posted
Rating:
#1 (In Topic #330)
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
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.

/comp/gb.qt4/control/.mousedown - Gambas Documentation

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

Public Sub _MouseDown()

Me.Tag = "Clicked!"

End

Is this possible?
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Have a look at the attached code. Let me know if this is what you wanted.

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.