need halp - workin with Timer show hide object

midan1

Member
Joined
Dec 10, 2006
Messages
9
Programming Experience
Beginner
i need to createa Windows Form
with timer that show hide "object" evry 10 minute
a flash shockwave flash
swf file
"Me.AxShockwaveFlash1.Visible = True"
how to do it
i need example
i am new in Windows Form
TNX
 
Get the Timer from the Toolbox and put it to the form. Set the Timer's property, interval to 10 minutes. The interval was count in milisecond, so you have to put 10 * 60 * 1000 = 600000 in the Timer's interval.

Double click on the Timer, and it will go to the code, and show the Timer's event. Put the code into the Timer's tick event:

VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Timer1_Tick([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] Timer1.Tick[/SIZE]
[SIZE=2]Me.AxShockwaveFlash1.Visible = NOT Me.AxShockwaveFlash1.Visible
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]
 
I think is something like this

VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Timer1_Tick([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] Timer1.Tick[/SIZE]
Timer1.Stop()
IF Me.AxShockwaveFlash1.Visible Then
   Timer1.interval = 540000
ELSE
   Timer1.interval = 60000
END IF
[SIZE=2]Me.AxShockwaveFlash1.Visible = NOT Me.AxShockwaveFlash1.Visible[/SIZE]
[SIZE=2]Timer1.Start()
[/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
 
not working !!
PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Stop()
IF Me.AxShockwaveFlash1.Visible Then
Timer1.interval = 540000
ELSE
Timer1.interval = 60000
END IF
Me.AxShockwaveFlash1.Visible = NOT Me.AxShockwaveFlash1.Visible
Timer1.Start()
End Sub
 
It looks ok to me ?

Did you set Me.AxShockwaveFlash1.Visible = True and Timer1.interval = 60000 when your form loads (before timer starts)
Then start the timer.

If i understand lingsn's code correctly, the flash movie should be visible for 1 minute... then stop, then after 9 minutes it's visible again for 1 minute etc.
 
Back
Top