how to use removehandler?

i’m creating container controls at runtime, i use addhandler to wire up the events to my method.
i keep an array with refernces to the objects and then when i remove them i call close and set them to nil

I’m struggling with how to remove the handlers.

how would i do this?

same as addhandler

Theres an example at the bottom of the addhandler page
http://documentation.xojo.com/index.php/AddHandler
http://documentation.xojo.com/index.php/RemoveHandler

yeah i’m doing that i think

for i as integer = fields.Ubound downto 0 removehandler fields(i).saveConfig, addressof updateFieldConfig removehandler fields(i).validate, addressof validateField fields(i).Close fields.Remove(i) next

It kind of works, but then after a couple of uses, my app crashes. i cant handle the exception either. i’m not sure what to look for now.

me either since all I have is the little bit you’ve posted here :slight_smile:

lol.

well… You know when you make a change and then it breaks , so you assume it was the latest change that broke it?

it seems the crash is really occurring on the editcell method of a subclassed listbox.

i will have to dig into it tomorrow. I obviously need some sleep.

Can you post the crash report?