VB Migration Partner partially supports the Screen.MousePointer property, by mapping it to the MousePointer property of the Screen6 object, defined in the support library. This property internally delegates to the MousePointer property of the active form, because there is no easy way to affect the global screen pointer under the .NET Framework.
The Screen6.MousePointer property is marked as obsolete, which causes both a migration warning to be issued and a compiler warning that is listed inside Visual Studio’s Error List. With dozens or hundreds of such warnings, you might easily want to suppress them.
Suppressing the migration warning is simple: you just issue a DisableMessage pragma for message 80F4. Suppressing the compilation warning requires that you transforms the reference to Screen6.MousePointer into a reference to Screen6.ActiveForm.MousePointer:
The pragmas used when converting to C# are slightly different:
If you are inside a form, you can transform the Screen6.MousePointer reference into Me.MousePointer, which delivers more concise code. A typical VB6 project contains more forms than modules or classes, therefore you’d better form having a project-level pragma that transforms into Me.MousePointer and then one pragma in each module or class that transforms into Screen6.ActiveForm.MousePointer:
This are the pragmas to be used when converting to C#
You can easily apply these pragmas to all the projects you plan to convert by saving it into the VBMigrationPartner.pragmas file.
A completely different – and more effective – approach can be used when the Screen.MousePointer property is used to display the “wait” cursor (the hourglass) during a lengthy operation and to later restore the mouse pointer to its default when the operation is completed. In this cases you really want to change the global cursor, not just the cursor of the current form. In .NET this is possible by means of the Application.UseWaitCursor property. The following two pragmas do the trick:
Use these pragmas when converting to C#: