Question: OnLeave or OnMouseLeave

  • Thread starter Thread starter Colin McGuire
  • Start date Start date
C

Colin McGuire

Hi, I have a child form - when the mouse is over the button on the
parent form, I show the child form. When the mouse cursor is moved
away from the button, I hide the child form.

My child form hiding code can override either OnMouseLeave or OnLeave,
and both work okay.

The online documentation for both events says "This is the preferred
technique for handling the event in a derived class."

Although my code works for both, I want to code it properly. Any
suggestions on which routine should I really be overriding and more
importantly why?
Thank you

Colin
 
* (e-mail address removed) (Colin McGuire) scripsit:
Hi, I have a child form - when the mouse is over the button on the
parent form, I show the child form. When the mouse cursor is moved
away from the button, I hide the child form.

My child form hiding code can override either OnMouseLeave or OnLeave,
and both work okay.

The online documentation for both events says "This is the preferred
technique for handling the event in a derived class."

Although my code works for both, I want to code it properly. Any
suggestions on which routine should I really be overriding and more
importantly why?

Are you sure you understood the difference between 'OnLeave' and
'OnMouseLeave'? Have a look in the documentation for these methods.
 
Thanks again Herfried - got it now.
Colin


Herfried K. Wagner said:
* (e-mail address removed) (Colin McGuire) scripsit:

Are you sure you understood the difference between 'OnLeave' and
'OnMouseLeave'? Have a look in the documentation for these methods.
 
Back
Top