[VB] Ander frame na bepaald aantal seconden

Pagina: 1
Acties:

  • Thunk
  • Registratie: Maart 2002
  • Laatst online: 05-09 14:13
Hallo, hoe wissel ik van frame na een bepaald aantal seconden? Bijv van frmSplash naar frmLogin na 5 seconden.
Kan dit gewoon met Time statements of moet ik er een component voor toevoegen (timer)?

  • Thunk
  • Registratie: Maart 2002
  • Laatst online: 05-09 14:13
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?

Verwijderd

De bedoeling van ReadyToWork snap ik niet echt, gaat dit niet?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 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()
SplashTimer.Enabled = False
HideSplash
End Sub

  • Thunk
  • Registratie: Maart 2002
  • Laatst online: 05-09 14:13
ja die werkt! hey bedankt gozer :) cya!