I subclassed a control and wrote code to the change event of the subclass. But there is also a change event in the superclass that should be done by the program.
How can I call the change event of the superclass from within the change event of the subclass?
[quote=35471:@Hank Sinclair]I subclassed a control and wrote code to the change event of the subclass. But there is also a change event in the superclass that should be done by the program.
How can I call the change event of the superclass from within the change event of the subclass?
Hank[/quote]
you don’t
events travel “down” the class hierarchy - they are a nice simple way to implement “chain of responsibility”
so if you implemented the event in the super the subclass would no longer get the event UNLESS you have added an event definition to the super an the raised the event in the super
[quote=35491:@Norman Palardy]so if you implemented the event in the super the subclass would no longer get the event UNLESS you have added an event definition to the super an the raised the event in the super
They’re saying the same thing. When you write your subclass, the Super class’s Change event fires and calls your Change event. If you want to pass the Change event on to instances of your subclass (on the window, for example) you would add an Event Definition to your subclass and call it from your Change event. As Norman said, event cascade down the chain from super to subclass.