An invisible panel won't throw any events, so the only way to really do this is with a timer and check whether or not the mouse is inside the control's area or not:
private Timer timer = new Timer();
public Form1() {
InitializeComponent();
timer.Tick += timer_Tick;
timer.Start();
}
void timer_Tick(object sender, EventArgs e) {
Rectangle r = pnlOne.RectangleToScreen(pnlOne.ClientRectangle);
if (r.Contains(MousePosition)) {
if (!pnlOne.Visible)
pnlOne.Visible = true;
} else {
if (pnlOne.Visible)
pnlOne.Visible = false;
}
}
No need to change the panel's Enabled property (just leave it Enabled=true;
) since you seem to only care to show the panel when the mouse is in the control's area.