Indice... ayuda xfavor

Roberto
23 de Mayo del 2006
Hola todos:

mi codigo obiamente es mucho + largo pero quisiera no dar + codigo si no les molesta...
mi codigo es:

Private Sub Form_Load()
timer2.interval = 1000
timer1.interval = 1
labelcr.caption = 30
end sub

Private Sub Timer1()
labelcr.caption = labelcr.caption -1
end sub

Private Sub Timer2()
if labelcr.caption = 0 then
labelcr.caption = 30
end if
if labelcr.caption = "10" then
file1.listindex = file1.listindex + 1 'error
end if
end sub

el error esta en la linea q sale "error" como comentario, sin comillas.
mi problema es el siguiente:
con la linea "file1.listindex = file1.listindex + 1" pretendo q el indice(listindex) se baje uno, es decir q cada vez q el timer pase x por 10, se baje un indice (listindex). si el indice (listindex) es 1 se haga 2, etc. ¿como puedo hacer esto? "file1.listindex = file1.listindex + 1" deberia funcionar pero el indice(listindex) se baja hasta el ultimo...

muchas gracias
Roberto

jhon
23 de Mayo del 2006
Recuerda q la unidad del intervalo del timer es el milisegundo, por lo que creo que 1 para timer es demasiado para el sistema.

Private Sub Form_Load()
Timer2.Interval = 500
Timer1.Interval = 250
labelcr.Caption = 30

End Sub

Private Sub Timer1_Timer()
labelcr.Caption = labelcr.Caption - 1
End Sub

Private Sub Timer2_Timer()
If labelcr.Caption = 0 Then
labelcr.Caption = 30
End If
If labelcr.Caption = "10" Then
List1.ListIndex = List1.ListIndex + 1
End If
End Sub

Saludos y suerte