How to Set Hourglass MousePointer in VB Program During Delays

ID: Q71105


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft Visual Basic programming system for Windows, version 1.0


SUMMARY

During operations that take time, you may decide to display the hourglass mouse cursor. This will let the user know that the computer is performing an operation that may take some noticeable time, and that no user input will be immediately processed during this time.


MORE INFORMATION

The MousePointer property can be set during design time or during run time. During operations that may take some noticeable amount of time, the MousePointer should be set to the hourglass pointer. This can be performed using the Screen.MousePointer property. Before setting the mouse pointer to the hourglass, you should save the present mouse pointer so that when you are through with the hourglass cursor, you can re-initialize it to the previous pointer. Listed below is an example of setting the pointer to the hourglass cursor:


Sub Form_Click ()
   SavedPointer = Screen.MousePointer  ' Save mouse pointer.
   Screen.MousePointer = 11            ' 11# = hourglass.
   For i = 1 To 10000: Next i          ' Some lengthy operation.
   Screen.MousePointer = SavedPointer  ' Set to previous mouse pointer.
End Sub 

Additional query words: VBmsdos

Keywords :
Version : MS-DOS:1.0; WINDOWS:1.0
Platform : MS-DOS WINDOWS
Issue type :


Last Reviewed: December 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.