See Also Example
Applies To
Form, check box control , directory list box , drive list box , file list box , frame , horizontal scroll bar , image , label , list box , option button , picture box , Screen object , text box , vertical scroll bar .
Description
Determines the type of mouse pointer displayed when the mouse is over a particular part of a form or control at run time.
Usage
{ [form.][control.]|Screen.}MousePointer[ = setting ]
Setting
The MousePointer property settings are:
Setting Description
0 (Default) Shape determined by the control
1 Arrow
2 Cross (cross-hair pointer)
3 I-Beam
4 Icon (small square within a square)
5 Size (four-pointed arrow pointing north, south, east, west)
6 Size NE SW (double arrow pointing northeast and southwest)
7 Size N S (double arrow pointing north and south)
8 Size NW SE (double arrow pointing northwest and southeast)
9 Size W E (double arrow pointing west and east)
10 Up Arrow
11 Hourglass (wait)
12 No Drop
Remarks
The MousePointer property controls the shape of the mouse pointer. This property is useful when you want to indicate changes in functionality as the mouse pointer passes over controls on a form or dialog box. The Hourglass setting (11) is useful for indicating that the user should wait for a process or operation to finish.
Note When set for the Screen object, MousePointer changes across the entire screen; that is, it overrides all MousePointer settings for other objects and other applications. Setting MousePointer to 0 (default) restores the previous behavior.
Data Type
Integer
Help:
DragIcon Property
MouseMove Event
Programmer's Guide:
Chapter 12, "Responding to Mouse Events"
The example changes the pointer to an hourglass while circles are drawn across your screen, and then changes the hourglass back to a pointer at the end of the procedure. To try this example, paste the code into the Declarations section of a form. Press F5 to run the program and then click the form.
Sub Form_Click ()
Dim I ' Declare variable.
Screen.MousePointer = 11 ' Change pointer to hourglass.
For I = 0 To ScaleWidth Step 50 ' Set random color and draw circles on form.
ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Circle (I, ScaleHeight * Rnd), 400
Next
Screen.MousePointer = 0 ' Return pointer to normal.
End Sub