How Do I Change the Mouse Cursor Icon? (Magic xpa 3.x)
In most situations, Magic xpa will set the mouse cursor as you would expect in a Windows application. However, you can change the default behavior when you have a special need to do so.
Magic xpa allows you to choose from a set of 14 different icons. These icons are standard within the Windows environment. Individual users may alter their own Windows setup, so that, for instance, the standard arrow is bigger or uses a different symbol.
To change which icon is currently in use, you use the SetCrsr() function, which has the syntax:
SetCrsr(number)
Where number is a value from 1-14, as shown above.
-
Go to the logic unit where you want to change the cursor shape. In this case, we are changing the cursor when the user clicks on the list of cursor types.
-
Create an Evaluate Expression operation.
-
Set the Expression to
SetCrsr (number)
Where number represents the shape of the cursor you want. It can be a hard-coded number from 1-14, or, as in this case, held in a numeric variable.
Now, whenever the logic unit is executed, the cursor will change shape.
Note: Be sure to turn the mouse icon back to its default when you are done with the specific procedure that called for a different icon.
The Online and Rich Client Samples projects (program HG02 and RHG02)