I have no idea what you mean by " the mouse cursor should not be active at this time.", so I'll only focus on hiding and showing the mouse cursor when moved over a certain form control.
You should be able to do that by declaring a MouseEnter and MouseLeave event handler function on the control like
$control.Add_MouseEnter( {
[System.Windows.Forms.Cursor]::Hide()
})
$control.Add_MouseLeave( {
[System.Windows.Forms.Cursor]::Show()
})
Edit
Thanks to your comment I now understand what you mean by the cursor being active or not.
To prevent the hidden cursor to be able to click on the control of form itself, add a check for this inside the control's Click event handler. Something like this:
$control.Add_Click({
# the [Cursor.Current] property returns null if the mouse cursor is not visible
# see: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor.current?redirectedfrom=MSDN&view=netframework-4.8#System_Windows_Forms_Cursor_Current
if (![System.Windows.Forms.Cursor]::Current) { return $false }
})
Another way of doing this could be to not only Hide or Show the mouse cursor when hovering over the control, but at the same time Enable or Disable the control. This will of course have the side-effect of the control's appearance changing..
$control.Add_MouseEnter( {
[System.Windows.Forms.Cursor]::Hide()
$this.Enabled = $false
})
$control.Add_MouseLeave( {
[System.Windows.Forms.Cursor]::Show()
$this.Enabled = $true
})