So i have a Panel which on Mouse Enter and Mouse Leave i change the visibility of some controls which are docked inside it.
Problem is whenever I hover over a control within the panel the Mouse Enter then moves to that indivual control and thus they are made invisible.
Is there any way i can make this work without having to code these two events for each control within the panel?
Cheers 🙂
Interesting problem. If you put a Console.WriteLine in the MouseEnter or MouseLeave you will notice that when your mouse moves over the control it hides which causes the mouse to be back over the panel which then shows the control which causes the control to hide …
The only way I figured out how to accomplish your request was to remove the MouseEnter and MouseLeave events. Then I added a MouseMove event to the form containing the panel. I also added a MouseMove event to the panel. Both events call a routine that checks the coordinates of the mouse to determine if it is over the panel. If the MouseCheck routine returns true then show the controls, if not then hide them. The sample below is C# but I’m sure you can grab the idea.