MouseLeave fired on childs controls, This does not have thus to be.

A

Alvaro E. Gonzalez

Hi;

A UserControl named ContainerInfo has children controls;
ContainerInfo also has the MouseLeave event.
But one goes off when the cursor of the mouse is in a children control .
This does not have thus to be, by a contracted being in ContainerInfo
mouse has not left this.

What I must do?
Regards
Alvaro.
 
G

Gabriele G. Ponti

One possible workaround is to check if the mouse is in fact outside the user
control area when the MouseLeave event is raised.

private void ContainerInfo_MouseLeave( object sender, EventArgs e )
{
if( !this.ClientRectangle.Contains( PointToClient(
Control.MousePosition ) ) )
{
// handle the event here
}
}
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top