How do I detect if the mouse position is outside a panel and its children in WinForm
The panel in this case is the blue box behind the per 100g and per item buttons.
I was going to use a mouse.Leave event to trigger when to hide my drop down menu however if the mouse 'leaves' the panel and hovers over the per 100g button it would trigger the event and hide the menu. So instead I trying to check if the mouse is outside the panels boundaries before hiding however the mouse location is much greater than the panel position even though the mouse is inside the panel. Anyone know how to convert the 2 positions into the correct values for this case? Thanks
3 Replies
wait i dont understand maybe my english sucks
if it leaves the blue panel what do you want it to do
hide the panel or what
also isnt there a Control.PointToClient(MousePos) thing which gives it relaitve to your mouse
Thank you for showing interest, i have managed to fix this issue now and it all works fine, i had to use a Control.PointToScreen to fix it
Oh thats what its called
Good job man