Guus2005
AWF VIP
- Local time
- Today, 21:49
- Joined
- Jun 26, 2007
- Messages
- 2,642
Howdy,
Some time ago i posted this. A class to turn the hourglass on and off again.
And some sample code how to use it:
After the procedure StartMeNext the hourglass is already turned off.
I want to add a counter to the class which counts the number of instances of that class.
Only then the counter reaches 1 the hourglass must be disabled.
I tried to use a static variable in the class but the scope doesn't reach into the next instance of the class.
I know i could use a global variable but then the class wouldn't be standalone anymore.
I know i have seen the solution somewhere but i can't reproduce it.
Thanks for your time!
Some time ago i posted this. A class to turn the hourglass on and off again.
Code:
Option Explicit
'
' clsHourglass
'
' This class sets the hourglass on and off. Also when you forget to turn it off.
'
Private Sub Class_Terminate()
HourGlassOff
End Sub
Public Sub HourGlassOn()
DoCmd.Hourglass True
End Sub
Public Sub HourGlassOff()
DoCmd.Hourglass False
End Sub
Code:
Option Explicit
Public Sub StartMeUp()
Dim cHourglass As New clsHourglass
cHourglass.HourGlassOn
StartMeNext
cHourglass.HourGlassOff
End Sub
Private Sub StartMeNext()
Dim cHourglass As New clsHourglass
cHourglass.HourGlassOn
'
'Lots of code here
'
cHourglass.HourGlassOff
End Sub
I want to add a counter to the class which counts the number of instances of that class.
Only then the counter reaches 1 the hourglass must be disabled.
I tried to use a static variable in the class but the scope doesn't reach into the next instance of the class.
I know i could use a global variable but then the class wouldn't be standalone anymore.
I know i have seen the solution somewhere but i can't reproduce it.
Thanks for your time!
Last edited: