Question Timer Problem

konnosgar

New member
Joined
Apr 14, 2012
Messages
1
Programming Experience
Beginner
I have a button, a timer and a panel
When i click the button timer1 starts

timer1.start()

timer has 3 ifs

if panel1.backcolor = color.red
if panel1.backcolor = color.green
if panel1.backcolor = color.blue

when the timer ticks both of 3 ifs runs
IS there a way that i can set the timer ticks for only 1 if ?
 
Obviously the Panel can only have one BackColor at a time so, if you find a match, why keep checking? You should not have three If statements. You should be using If...ElseIf...ElseIf. If the first one is True then the next two aren't even tested.
 
Back
Top