[Solved] C# how to get the element in the form where the mouse is above


From comments:

You needed to get the string name of a panel over where the mouse was hovering

Attaching a handler to the MouseHover event of a control will cause your code handler to run when the mouse hovers over that control. The control experiencing the hover is passed to the handler as the sender argument which, for legacy reasons, is an object instead of anything more specific. Cast it to e.g. a Panel, or Control; anything in the hierarchy at or below the point where a Name property is made available (first available in Control)

Other applicable events that could be used: MouseEnter, MouseLeave, Click etc

2

solved C# how to get the element in the form where the mouse is above