Traffic lights in vb6 resolved
time2change
Messages postés
60
Statut
Membre
-
time2change Messages postés 60 Statut Membre -
time2change Messages postés 60 Statut Membre -
hi. i'm tryin to make a traffic lights in vb6, but my code is not workin, plz i need some help to know my mistakes.
i have 3 timers, 1 commandbutton, 3 shapes with the 3 colors(red, yellow & green).
this is my code:
Private Sub Command1_Click()
If Command1 = True Then
Shape1.Visible = True
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
If Interval = 0 Then
Shape1.Visible = False
Timer2.Enabled = True
Shape2.Visible = True
End If
End Sub
Private Sub Timer2_Timer()
If Interval = 0 Then
Shape2.Visible = False
Timer3.Enabled = True
Shape3.Visible = True
End If
End Sub
Private Sub Timer3_Timer()
If Interval = 0 Then
Shape3.Visible = False
Timer1.Enabled = True
Shape1.Visible = True
End If
End Sub
merci d'avance.
i have 3 timers, 1 commandbutton, 3 shapes with the 3 colors(red, yellow & green).
this is my code:
Private Sub Command1_Click()
If Command1 = True Then
Shape1.Visible = True
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
If Interval = 0 Then
Shape1.Visible = False
Timer2.Enabled = True
Shape2.Visible = True
End If
End Sub
Private Sub Timer2_Timer()
If Interval = 0 Then
Shape2.Visible = False
Timer3.Enabled = True
Shape3.Visible = True
End If
End Sub
Private Sub Timer3_Timer()
If Interval = 0 Then
Shape3.Visible = False
Timer1.Enabled = True
Shape1.Visible = True
End If
End Sub
merci d'avance.
A voir également:
- Traffic lights in vb6 resolved
- Vb6 - Télécharger - Divers Utilitaires
- Girl in the basement streaming vf - Forum Cinéma / Télé
- Navigation in private - Guide
- Dc in - Forum Disque dur / SSD
- Aux in ✓ - Forum Enceintes / HiFi
10 réponses
Hi,
I'm not sure that it's what you want:
;o)
I'm not sure that it's what you want:
Private Sub Command1_Click()
Shape1.Visible = False
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer2.Interval = 1000
Timer3.Interval = 1000
Shape1.Visible = False
Shape2.Visible = False
Shape3.Visible = False
End Sub
Private Sub Timer1_Timer()
Shape1.Visible = True
Shape3.Visible = False
Timer2.Enabled = True
Shape2.Visible = False
Timer1.Enabled = False
End Sub
Private Sub Timer2_Timer()
Shape2.Visible = True
Shape1.Visible = False
Timer3.Enabled = True
Shape3.Visible = False
Timer2.Enabled = False
End Sub
Private Sub Timer3_Timer()
Shape3.Visible = True
Shape2.Visible = False
Timer1.Enabled = True
Shape1.Visible = False
Timer3.Enabled = False
End Sub
;o)
ps: enabled=false for all the timers & visible=false for all the shapes.
Private Sub Command1_Click()
If Command1 = True Then
Shape1.Visible = True
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
If Interval = 0 Then
Timer1.Enabled = False
Shape1.Visible = False
Shape3.Visible = False
Timer2.Enabled = True
Shape2.Visible = True
End If
End Sub
Private Sub Timer2_Timer()
If Interval = 0 Then
Timer2.Enabled = False
Shape1.Visible = False
Shape2.Visible = False
Timer3.Enabled = True
Shape3.Visible = True
End If
End Sub
Private Sub Timer3_Timer()
If Interval = 0 Then
Timer3.Enabled = False
Shape3.Visible = False
Shape2.Visible = False
Timer1.Enabled = True
Shape1.Visible = True
End If
End Sub
Private Sub Command1_Click()
If Command1 = True Then
Shape1.Visible = True
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
If Interval = 0 Then
Timer1.Enabled = False
Shape1.Visible = False
Shape3.Visible = False
Timer2.Enabled = True
Shape2.Visible = True
End If
End Sub
Private Sub Timer2_Timer()
If Interval = 0 Then
Timer2.Enabled = False
Shape1.Visible = False
Shape2.Visible = False
Timer3.Enabled = True
Shape3.Visible = True
End If
End Sub
Private Sub Timer3_Timer()
If Interval = 0 Then
Timer3.Enabled = False
Shape3.Visible = False
Shape2.Visible = False
Timer1.Enabled = True
Shape1.Visible = True
End If
End Sub
The interval specifies the frequency of excécution a code. For one second > Interval = 1000. For 5 seconds> Interval = 5000 ...
If the interval is zero, nothing happens
If the interval is zero, nothing happens
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
yeah ur right.
i wanted to regist my work as .exe but this option is disactivated cuz i only have vb portable. any suggestions ??
i wanted to regist my work as .exe but this option is disactivated cuz i only have vb portable. any suggestions ??
i'm sorry but compiled to wht?? i have no idea wht ur talkin abt, i told u i just started vb6 so i rono wht i suppose to do to creat .exe
Please don't use abbreviations. I don't understand everything you write. My English is not very good. I'm sorry.
It must first save the project before making an exe.
It must first save the project before making an exe.
sorry i didn't know.
i said that i'm not that good with vb6, so i dont know how to creat .exe
tell me what i should do to make it .exe plz, because i never tried it before ??
i said that i'm not that good with vb6, so i dont know how to creat .exe
tell me what i should do to make it .exe plz, because i never tried it before ??