How to put 3 Timers in Windows Form and play

midan1

Member
Joined
Dec 10, 2006
Messages
9
Programming Experience
Beginner
need halp
how to put 3 Timers
that evry timer show/hide object layer
that every timer depending by another
like this
  • timer 1 start
show
WebBrowser object page
for 5 minute
HIDE

  • timer 2 start
show
flash shockwave flash file
for 3 minute
HIDE
  • timer 3 start
show
WebBrowser object page2
for 2 minute
HIDE
-------
and start timer 1
LOOP
like layer over layer hide show
TNX
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,283
Location
Norway
Programming Experience
10+
You only need one timer, set Interval to 1000ms. Example:
Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles Timer1.Tick
        Static seconds As Integer
        seconds += 1
        Select Case seconds
            Case 1
                'show WebBrowser object page1 (for 5 minutes)
            Case 5 * 60
                'hide WebBrowser
                'Show flash shockwave flash file (for 3 minutes)
            Case 8 * 60
                'hide flash
                'show WebBrowser object page2 (for 2 minutes)
            Case 10 * 60
                seconds = 0
        End Select
    End Sub
 

midan1

Member
Joined
Dec 10, 2006
Messages
9
Programming Experience
Beginner
TNX
need halp
i have problem to run the code see my code
and in "Case 1"
how can i change the Interval like in (Case 2+Case 3)
---------------------------------
PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Timer1.Tick
Static seconds AsInteger
seconds += 1
SelectCase seconds
Case 1
AxWebBrowser1.Navigate("http://localhost/aspdocs/zx.asp")
Me.AxWebBrowser1.Visible = False
'show WebBrowser object page1 (for 5 minutes)
'Me.AxWebBrowser1.Visible = Not Me.AxWebBrowser1.Visible
'Me.AxWebBrowser1.Visible = False
Case 5 * 60
'hide WebBrowser
'Show flash shockwave flash file (for 3 minutes)
Me.AxShockwaveFlash1.Visible = NotMe.AxShockwaveFlash1.Visible
Case 8 * 60
'hide flash
'show WebBrowser object page2 (for 2 minutes)
AxWebBrowser1.Navigate("http://localhost/aspdocs/login.asp")
Me.AxWebBrowser2.Visible = False
Case 10 * 60
seconds = 0
EndSelect
EndSub
------------------------
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,283
Location
Norway
Programming Experience
10+
I think you're suppose to do this:
first case:
show WebBrowser (page1)
second case:
hide WebBrowser
Show flash
third case:
hide flash
show WebBrowser (page2)

(the cases and code above makes the assumption you know that 1 minute = 60 seconds)
 
Top Bottom