New object

Hi!

I created a subclass named “myDTF” of desktopTextField

then, i put a code at FocusLost (on my subclass)

how to access FocusLost Event Handler on myDTF object? it’s not there.

Thank you!

Once you handle an event in a class, the instance of that class no longer gets that event (because it’s already been handled). You’ll need to add an Event Definition in your subclass:

Event FocusLost

…and then raise it in the subclass’s FocusLost event handler:

RaiseEvent FocusLost

The class instance in your window will now have a FocusLost event that it can handle.

2 Likes

Don’t forget that after you add an event to a subclass, you can right-click on it in the Navigator and select Add Event Definition. The IDE will automatically create the new event and copy its parameters for you.

5 Likes

Hi!

i have a code on Focus Lost Event Handler

i added a FocusLost Event Definitions too.

i added the event hander on my object:

But the focus lost do not trigger…
Where / how to “RaiseEvent FocusLost”?

Thank you!

Can you share a sample project?
May be easier for someone to review and give you exact information.

Even if you don’t create the FocusLost definition or add it to your TextField1, the FocusLost should fire as long as TextField1 has Super as alemac_desktopTextField.

You should call

RaiseEvent FocusLost

Inside the FocusLost event that you implemented. Before or after your code is up to you.

1 Like

You raise at the end of your class’s FocusLost event, probably.