Re: help with timer
- From: PeterD <peter2@xxxxxxxxxx>
- Date: Thu, 04 Jan 2007 14:19:41 -0500
On Thu, 4 Jan 2007 10:37:00 -0800, lubian
<lubian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have array of shapes.How i can use timer to flash shape for 5 seconds and
then flash next shape for same time, and when its finished flashing last one
from array return to first one to do same untill something not clicked, then
it will stop. Do i need 2 timers? 1 for flashing the shape and 1 for moving
between shapes?For flashing i just change bordercolor, is there another way
to flash it?
for now i did small code, but its flash all of them together and thats not
right.I know i doing something wrong.
qX and qY globals,mean how many shapes in line and how many lines.
Private Sub tmr1_Timer()
For a = 1 To qX * qY
If shp(a).BorderColor = vbBlue Then
shp(a).BorderColor = vbBlack
Else: shp(a).BorderColor = vbBlue
End If
Next
End Sub
Like this:
dim nCurrentShape as integer
Private Sub tmr1_Timer()
if (nCurrentShape > (qX * Qy)) then nCurrentShape = 0
If shp(nCurrentShape).BorderColor = vbBlue Then
shp(nCurrentShape).BorderColor = vbBlack
Else
shp(nCurrentShape).BorderColor = vbBlue
End If
nCurrentShape = nCurrentShape + 1
End Sub
.
- Follow-Ups:
- Re: help with timer
- From: lubian
- Re: help with timer
- Prev by Date: subclass blows up IDE - MDI form
- Next by Date: Re: Weird infinite loop
- Previous by thread: subclass blows up IDE - MDI form
- Next by thread: Re: help with timer
- Index(es):
Relevant Pages
|