• Sábado 21 de Diciembre de 2024, 11:15

Autor Tema:  alguien que me ayude por favor  (Leído 1736 veces)

aledefa

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
alguien que me ayude por favor
« en: Sábado 23 de Enero de 2010, 19:17 »
0
buenas tardes estoy haciendo un codigo en visual basic soy estudiante del 2 ano de electricidad en telecomunicaciones y estamos empezando con visual soyy muy principiante...

agradeceria mucho a quien pueda ayudarme !!

me han mandado hacer un programa que tenga un circulo de leds ( simulados con shapes )

y que posea un frame con tres opciones ( sentido horario, antihorario  y titilar )

ya la mayyor parte la he hecho ahora no se como hacer para q los 12 shapes ( leds en mi caso) titilen cuando le de a la opcion del frame de titilar .. estoy usando tres clocks uno para el sentido horario otro parael sentido antihorario y otro para titilar aqui les dejo un poco el codigo que he realizado a ver sialguien me puede ayudarr ... gracias de antesmano


Dim a As Integer
Dim flag As Integer
Dim b As Integer


Private Sub Command1_Click()

Shape1.FillColor = vbGreen
Shape2.FillColor = vbGreen
Shape12.FillColor = vbGreen
Shape11.FillColor = vbGreen



End Sub

Private Sub Command2_Click()

Shape3.FillColor = vbRed
Shape7.FillColor = vbRed
Shape8.FillColor = vbRed
Shape9.FillColor = vbRed
Shape6.FillColor = vbRed



End Sub

Private Sub Command3_Click()

Shape5.FillColor = vbYellow
Shape4.FillColor = vbYellow
Shape10.FillColor = vbYellow




End Sub

Private Sub Form_Load()

Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0






End Sub

Private Sub Option1_Click()

Timer1.Enabled = True
a = 1


End Sub

Private Sub Option2_Click()

Timer2.Enabled = True
b = 1


End Sub

Private Sub Option3_Click()

Timer3.Enabled = False

flag = 1


End Sub

Private Sub Timer1_Timer()


Timer1.Enabled = False

Select Case a

    Case 1
   
    Shape1.FillColor = vbGreen
   

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
   
    Case 2
   
    Shape3.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0


Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
   
    Case 3
   
    Shape7.FillColor = vbRed
   Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0


Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
    Case 4
   
    Shape8.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
    Case 5
   
    Shape9.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0


Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
    Case 6
   
    Shape6.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
    Case 7
   
    Shape5.FillColor = vbYellow
   
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0


Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
   
   
    Case 8
   
    Shape4.FillColor = vbYellow
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
    Case 9
   
    Shape10.FillColor = vbYellow
   
Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0


Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
   
   
    Case 10
   
    Shape11.FillColor = vbGreen

Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
    Case 11
   
    Shape12.FillColor = vbGreen
   
Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

   
    Case 12
   
    Shape2.FillColor = vbGreen
   
Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   
    Case Else
   
    a = 0

End Select

a = a + 1

Timer1.Enabled = True



End Sub

Private Sub Timer2_Timer()

Timer2.Enabled = False

Select Case b

Case 1

Shape1.FillColor = vbGreen
   

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0


Case 2

Shape2.FillColor = vbGreen
   
Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0


Case 3

  Shape12.FillColor = vbGreen
   
Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0



Case 4

 Shape11.FillColor = vbGreen

Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0

Case 5

Shape10.FillColor = vbYellow
   
Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0


Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0

Case 6

Shape4.FillColor = vbYellow
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0


Case 7

    Shape5.FillColor = vbYellow
   
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0


Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   

Case 8

Shape6.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   

Case 9

  Shape9.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0


Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0

Case 10

Shape8.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
   


Case 11

Shape7.FillColor = vbRed
   Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0

Shape3.FillColor = vbWhite
Shape3.FillStyle = 0

Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0


Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0

Case 12
 
 Shape3.FillColor = vbRed
   
    Shape1.FillColor = vbWhite
Shape1.FillStyle = 0

Shape2.FillColor = vbWhite
Shape2.FillStyle = 0


Shape4.FillColor = vbWhite
Shape4.FillStyle = 0

Shape5.FillColor = vbWhite
Shape5.FillStyle = 0

Shape6.FillColor = vbWhite
Shape6.FillStyle = 0

Shape7.FillColor = vbWhite
Shape7.FillStyle = 0

Shape8.FillColor = vbWhite
Shape8.FillStyle = 0

Shape9.FillColor = vbWhite
Shape9.FillStyle = 0

Shape10.FillColor = vbWhite
Shape10.FillStyle = 0

Shape11.FillColor = vbWhite
Shape11.FillStyle = 0

Shape12.FillColor = vbWhite
Shape12.FillStyle = 0
 
 
 
 Case Else
 
 b = 0
 
 End Select
 
 b = b + 1
 
 Timer2.Enabled = True
 

 
 
End Sub

Private Sub Timer3_Timer() |||*** es aqui donde quiero que me titilen los leds ****|||||||

Timer3.Enabled = False

If flag = 0 Then

Shape1.FillColor = vbGreen

flag = 1


     Else
     
   
    Shape1.FillColor = vbWhite
   
End If

Timer3.Enabled = True



End Sub

Nebire

  • Miembro HIPER activo
  • ****
  • Mensajes: 670
    • Ver Perfil
Re: alguien que me ayude por favor
« Respuesta #1 en: Domingo 24 de Enero de 2010, 18:17 »
0
Es bastante sencillo...


Te pongo un código que espero que te resulte fácil de entender
En el formulario hay que añadir 1 SOLO timer que llamamos TimLed
Añadimos un shape que llamamos  ShaLed es una matriz, al primero le pones el índice 0 (en diseño) , los restantes los cargamos por código
Añadimos un frame llamado frame1 y tres controles option llamados option1, forman una matriz tiene índices 0,1 y 2 . Para que coincida con elcódigo al indice 0
le ponemos el caption de 'horario ', al 1 "antihorario" y al 2 "parpadeante"...

Eso es todo copias y pegas el código y le das ejecutar...

una imagen del resultado:


Código: Visual Basic
  1.  
  2. Private Enum ModoIluminado
  3.     LUM_HORARIO = 0
  4.     LUM_ANTI_HORARIO = 1
  5.     LUM_PARAPDEO = 2
  6. End Enum
  7.  
  8. Private Const Encendido = vbRed   ' color del led encendido
  9. Private Const Apagado = &HC0C0FF  ' color del led apagado
  10. Private Ilumina As ModoIluminado  ' modo en que se iluminan los leds
  11. Private LedActual As Byte         ' led que se enciende actualmente
  12.  
  13.  
  14. Private Sub Form_Load()
  15.     Dim k As Single, x As Single, y As Single
  16.     Dim radian As Single
  17.     Dim resp As VbMsgBoxResult
  18.    
  19.     ' mostramos el formulario para ir viendo (si vamos paso a paso) como se realizan estas acciones.
  20.      Me.Show
  21.      
  22.     ' damos forma al shape
  23.     With ShaLed(0)
  24.         .Move .Width, .Height
  25.         .FillStyle = 0  ' sólido
  26.         .FillColor = Apagado
  27.         .Shape = 3 ' círculo
  28.     End With
  29.  
  30.    ' Cramos dinámicamente los otros 11 leds...
  31.     For k = 1 To 11
  32.         Load ShaLed(k)
  33.         ShaLed(k).Move ShaLed(k - 1).Left + ShaLed(k).Width
  34.         ShaLed(k).Visible = True
  35.     Next
  36.    
  37.     ' aseguramos unas medidas y dividimos el form. en 4 cuadrantes de 120 partes cada una
  38.     Me.ScaleMode = vbPixels
  39.     Me.Width = ScaleX(640, vbPixels, vbTwips)
  40.     Me.Height = Me.Width
  41.     Me.Scale (-120, -120)-(120, 120)
  42.    
  43.     ' centramos el frame..
  44.     Frame1.Move -Frame1.Width / 2, -Frame1.Height / 2
  45.    
  46.     ' posicionamos los leds en círculo respecto del centro (cordenada 0,0
  47.     For k = 0 To 11
  48.         radian = 6.28 / 12 * k
  49.         x = Cos(radian) * 60 + Sin(radian) * 60
  50.         y = Cos(radian) * 60 - Sin(radian) * 60
  51.         ShaLed(k).Move x - 15, y - 15
  52.     Next
  53.    
  54.     TimLed.Interval = 100 ' un tiempo que permita apreciar el cambio.
  55.     LedActual = 0
  56.    
  57.    
  58.    
  59.     resp = InputBox("Elija el modo inicial de iluminación:" & vbCrLf & "0 : Iluminación en sentido horario." & vbCrLf & "1 :  Iluminación en sentido antihorario." & vbCrLf & "2 : Iluminación parpadeante alterna." & vbCrLf & "cualquier otra plsación se interpreta como 0", "Iniciamos, la iluminación de los leds...", "0")
  60.     If resp < 1 Or resp > 2 Then resp = 0
  61.    
  62.     ' desactivamos previamente toodas las opciones, para que al activar uno, se invoque la rutina...
  63.     For k = 0 To 2
  64.         Option1(k).Value = False
  65.     Next
  66.     Option1(CInt(resp)).Value = True
  67. End Sub
  68.  
  69. Private Sub Option1_Click(Index As Integer)
  70.     Dim k As Byte
  71.    
  72.     ' 1º apagamos el timer
  73.     TimLed.Enabled = False
  74.     ' 2º marcamos el modo de iluminación
  75.     Ilumina = Index
  76.     ' 3º apagamos todos los leds.
  77.     For k = 0 To 11
  78.         ShaLed(k).FillColor = Apagado
  79.     Next
  80.    
  81.     ' hacemos que el led actual sea el primero, el 0
  82.     LedActual = 0
  83.     ' 4º ponemos en marcha el nuevo modo de iluminación
  84.     TimLed.Enabled = True
  85. End Sub
  86.  
  87. ' aquí se ejecuta todo
  88. Private Sub TimLed_Timer()
  89.     Dim anterior As Byte
  90.    
  91.  
  92.     If Ilumina = LUM_HORARIO Then
  93.         ' 1º marcamos el que ahora está encendido para apagarlo
  94.         If LedActual = 11 Then
  95.             anterior = 0
  96.         Else
  97.             anterior = LedActual + 1
  98.         End If
  99.         ' 2º lo apagamos
  100.         ShaLed(anterior).FillColor = Apagado
  101.         ' 3º marcamos el siguiente para encenderse
  102.         If LedActual > 0 Then
  103.             LedActual = LedActual - 1
  104.         Else
  105.             LedActual = 11
  106.         End If
  107.         ' 4º lo encendemos
  108.         ShaLed(LedActual).FillColor = Encendido
  109.     ElseIf Ilumina = LUM_ANTI_HORARIO Then
  110.         ' 1º marcamos el que ahora está encendido para apagarlo
  111.         If LedActual = 0 Then
  112.             anterior = 11
  113.         Else
  114.             anterior = LedActual - 1
  115.         End If
  116.         ' 2º lo apagamos
  117.         ShaLed(anterior).FillColor = Apagado
  118.         ' 3º marcamos el siguiente para encenderse
  119.         If LedActual < 11 Then
  120.             LedActual = LedActual + 1
  121.         Else
  122.             LedActual = 0
  123.         End If
  124.         ' 4º lo encendemos
  125.         ShaLed(LedActual).FillColor = Encendido
  126.     Else
  127.         anterior = LedActual
  128.         LedActual = (LedActual + 1) Mod 2
  129.         For k = 0 To 10 Step 2
  130.             ShaLed(k + anterior).FillColor = Apagado
  131.             ShaLed(k + LedActual).FillColor = Encendido
  132.         Next
  133.     End If
  134. End Sub
  135.  
  136.  
  137.  

Si tienes problemas o no entiendes algo, pegunta...
«Ma non troppo»
----> ModoVacaciones = False<----