Hide cursor on my form

Viewed 13266

I need help on how to hide the cursor when the mouse is over one of my application forms. I know the code is Cursor.Hide() and Cursor.Show() for the MouseEnter and MouseLeave events respectively. Applying this to the form itself doesn't work. So I inserted a panel (set its Dock property to Fill) to contain the other controls. The code worked for the panel but when I started adding controls, it didn't.
My guess is that I have to apply the code to each control. With about 25 controls on my form, that seems rather clumsy.
My idea was this (I'm sorry for the formatting; I'm typing this from a dumbphone):

foreach(Control control in this.Controls)
{
    control.MouseEnter += control_MouseEnter;
    control.MouseLeave += control_MouseLeave;
}

The code was inside FrmScreen_Load. But it still doesn't work. Am I missing something?

I'm working in C# but solutions in VB.NET are acceptable.

2 Answers
Related