by Dennis F McGrath (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (2 Votes)
Greatly simplifies mousepointer control, while at the same time avoiding unnecessary changes (less flicker), and uses DoEvents to assure that the displayed mousepointer changes in a timely manner. -- At the top of any Sub/Function in which you want to control the mousepointer: Dim oMp As CMousePointer -- and -- Set oMp = New CMousepointer -- This will remember the current mousepointer and set the mousepointer to vbHourglass. -- If you actually want to force to vbDefault, as in an error handling Sub/Function, or in cases where you want to set to vbHourglass conditionaly, add: oMp.Houglass = False -- or -- oMp.Value = vbDefault -- You can use the Hourglass or Value properties to change the mousepointer anywhere else in your Function. -- In the exit routine: Set oMp = Nothing --
This will reset the mousepointer to whatever it was on entering the Sub/Function
Inputs
Two properties to be used on the few occasions where vbHourglass is not the desired mousepointer.
Hourglass: A boolean, False being vbDefault.
Value: Any valid mousepointer value.
Download CMousePointer.cls (1007 Bytes)