In C#, we have the following:
- A
UserControl
containing aPictureBox
and an invisibleFlowPanel
.
What I want to achieve:
- When the
UserControl
is hovered (MouseHover
), the invisibleFlowPanel
will be set tovisible = true
. When the mouse leaves theUserControl
orFlowPanel
, theFlowPanel
should be setvisible = false
.
Using MouseLeave
on UserControl
doesn't do the job, because this event is triggered when the mouse enters FlowPanel
. Hiding the FlowPanel
when the mouse leaves FlowPanel
does it, but is buggy (sometimes MouseLeave
is triggered, sometimes not).
What's the best way to fix this?