Question: OnLeave or OnMouseLeave

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
 
H

Herfried K. Wagner [MVP]

* (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.
 
C

Colin McGuire

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top