Re: help with timer

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
.



Relevant Pages

  • Re: help with timer
    ... then flash next shape for same time, and when its finished flashing last one ... Private Sub tmr1_Timer ... If shp.BorderColor = vbBlue Then ...
    (microsoft.public.vb.general.discussion)
  • Re: help with timer
    ... then flash next shape for same time, and when its finished flashing last ... Private Sub tmr1_Timer ... If shp.BorderColor = vbBlue Then ...
    (microsoft.public.vb.general.discussion)
  • Re: flashing textbox
    ... >tried to pattern it after the one for a label flashing ... Private Sub Form_Timer ... And set the Timer Interval to 500 to flash every 1/2 second. ... You might consider just a bold/bright label to alert the ...
    (microsoft.public.access.formscoding)
  • Re: Flashing data
    ... Where the dates in both fields are the same, things flash ... Private Sub Form_Current ... One approach to dealing with a "group" of controls is to set ... For Each ctl In Me.Control ...
    (microsoft.public.access.modulesdaovba)
  • Re: Changing toolbar images
    ... Private Sub Timer1_Timer ... To flash the icon, call: ... : Does anyone know a way to way to change a vb6 toolbar button image 'on the: fly'. ... but I cant find a way of changing the button icon at: runtime. ...
    (microsoft.public.vb.winapi)