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
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.