Hi, I am Learning vb at a night course and need help with a timer project.
I want to display an image on the form for five different states.
Using Select case statements
As in
Case 0 image visible for 3 seconds
Case 1 image not visible for 1 second
Case 2 image visible for 1 second
Case 3 image not visible for 1 second
Case 4 image visible for 1 second
Case 5 image not visible for 3 second
This is the code I tried but did not work
Any ideas would help
Thanks
Duf
Dim picture as integer
Private Sub Form_Load()
Picture = 0
End sub
Private Sub tmrImage_Timer()
For picture = 0 to 6 -1
Select case picture
Case is = 0
Static counter0
If (counter < 3) then
Image.visable = true
End if
Counter0 = counter0 + 1
Case is = 1
Static counter1
If (counter1 < 1) then
Image.visable = False
End if
Counter1 = counter1 + 1
Case is = 2
Static counter2
If (counter2 < 1) then
Image.visable = True
End if
Counter2 = counter2 + 1
Case is = 3
Static counter3
static counter3
if (counter3 < 1) then
image.visable = false
end if
counter3 = counter3 + 1
case is = 4
static counter4
if (counter < 1 ) then
image.visable = true
end if
counter4 = counter4 + 1
case is = 5
static counter5
if (counter < 3 ) then
image.visable = false
end if
counter5 = counter5 + 1
end select
next picture
End sub
I want to display an image on the form for five different states.
Using Select case statements
As in
Case 0 image visible for 3 seconds
Case 1 image not visible for 1 second
Case 2 image visible for 1 second
Case 3 image not visible for 1 second
Case 4 image visible for 1 second
Case 5 image not visible for 3 second
This is the code I tried but did not work
Any ideas would help
Thanks
Duf
Dim picture as integer
Private Sub Form_Load()
Picture = 0
End sub
Private Sub tmrImage_Timer()
For picture = 0 to 6 -1
Select case picture
Case is = 0
Static counter0
If (counter < 3) then
Image.visable = true
End if
Counter0 = counter0 + 1
Case is = 1
Static counter1
If (counter1 < 1) then
Image.visable = False
End if
Counter1 = counter1 + 1
Case is = 2
Static counter2
If (counter2 < 1) then
Image.visable = True
End if
Counter2 = counter2 + 1
Case is = 3
Static counter3
static counter3
if (counter3 < 1) then
image.visable = false
end if
counter3 = counter3 + 1
case is = 4
static counter4
if (counter < 1 ) then
image.visable = true
end if
counter4 = counter4 + 1
case is = 5
static counter5
if (counter < 3 ) then
image.visable = false
end if
counter5 = counter5 + 1
end select
next picture
End sub