understanding base.Mouseup event

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

If a derived class handles MyBase.Mouseup does the base class have to raise
the event?

If both the base and derived class handle it will they both receive it?

If the base overrides OnMouseup and does MyBase.OnMouseUp(mea) does that
effect any of the above answers?

Thanks in advance for any insight passed along
 
* " Just Me said:
If a derived class handles MyBase.Mouseup does the base class have to raise
the event?
Yes.

If both the base and derived class handle it will they both receive it?
Yes.

If the base overrides OnMouseup and does MyBase.OnMouseUp(mea) does that
effect any of the above answers?

No. If you don't call 'OnMouseUp' in the base class, the event will not
be raised at all and the handlers are not called.
 
I'm sorry but the way I asked the questions I'm still confused.

---------------------------
So I need to code a MouseUp event in the base class and raise it?
Or does the base class raise it without my help?
--------------------------

Only if the base class raises with my code as described above?

What if I don't code to raise a MouseUp event in the base?


Thanks a lot
 
* " Just Me said:
So I need to code a MouseUp event in the base class and raise it?

No, if it is already raised by the base class' base class. In other
words: If 'Foo2' inherits from 'Foo1' and 'Foo1' raises the 'Goo'
event, it will be raised for 'Foo2' too.
Only if the base class raises with my code as described above?

What if I don't code to raise a MouseUp event in the base?

If a class' base class raises an event, it will be raised in the class
too, except you override the 'On<event name>' procedure in the derived
class and do not call the base class' 'On<event name>' procedure.
 
Thanks a lot, again

Think I've got it now!

Herfried K. Wagner said:
No, if it is already raised by the base class' base class. In other
words: If 'Foo2' inherits from 'Foo1' and 'Foo1' raises the 'Goo'
event, it will be raised for 'Foo2' too.


If a class' base class raises an event, it will be raised in the class
too, except you override the 'On<event name>' procedure in the derived
class and do not call the base class' 'On<event name>' procedure.
 
Back
Top