Ahora les dejamos el sigueinte ejercicio en visual básic, en dodnde se puede simular el vuelo de una mariposa se requiere de dos imagéne.
Imagen1 |
visible |
True |
Imagen2 |
visible |
False |
Imagen3 |
visible |
false |
Time1 |
interval |
200 |
codigo en el reloj
Private Sub Timer1_Timer()
Static PickBmp As Integer
Main.Move Main.Left, Main.Top
' For a variation, use the following line instead of the preceding one.
' Main.Move (Main.Left + 20) Mod ScaleWidth, (Main.Top - 5 + ScaleHeight) Mod ScaleHeight
If PickBmp Then
Main.Picture = OpenWings.Picture ' Displays the open butterfly picture.
Else
Main.Picture = CloseWings.Picture ' Displays the closed butterfly picture.
End If
PickBmp = Not PickBmp ' Toggle the value.
End Sub
Static PickBmp As Integer
Main.Move Main.Left, Main.Top
' For a variation, use the following line instead of the preceding one.
' Main.Move (Main.Left + 20) Mod ScaleWidth, (Main.Top - 5 + ScaleHeight) Mod ScaleHeight
If PickBmp Then
Main.Picture = OpenWings.Picture ' Displays the open butterfly picture.
Else
Main.Picture = CloseWings.Picture ' Displays the closed butterfly picture.
End If
PickBmp = Not PickBmp ' Toggle the value.
End Sub
No hay comentarios:
Publicar un comentario