Ik heb nu:
Private ReadyToUnload As Boolean
Private TimerExpired As Boolean
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const HWND_TOPMOST = -1
Private Sub HideSplash()
frmLogin.Enabled = True
frmLogin.Visible = True
Unload Me
End Sub
Public Sub ReadyToWork()
ReadyToUnload = True
If TimerExpired Then Hidesplash
End Sub
Public Sub ShowSplash()
SplashTimer.Interval = 3000
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
Me.Show
End Sub
Private Sub SplashTimer_Timer()
TimerExpired = True
SplashTimer.Enabled = False
If ReadyToUnload Then HideSplash
End Sub
Als ik SplashTimer.Enabled = False dit ff doe foo.Enabled dan zegt ie na 3 secs wel van, ongeldig, maar als ik dit normaal SplashTimer doe, doet hij niks na 3 secs?.. wat doe ik fout dan?