You are on page 1of 8

TESE SISTEMAS

Materia: Simulación Alumno: Arteaga Vázquez Brenda


Actividad: Tarea:2 Practica: Descripción: U3 Tarea 2
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Label1.Text = Format(Now, "Long TIME")
End Sub
End Class

Arteaga Brenda

2.-
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Timer1.Enabled = True
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click
Timer1.Enabled = False

End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick


Label1.Text = Format(Now, "Long TIME")
End Sub
End Class

Arteaga Brenda
Arteaga Brenda

Arteaga Brenda

3.-
Public Class Form1
Private Sub HScroll1_Change()
'Mostramos en la barra de titulo del form el valor del SCrollBar
Me.Caption = "Intervalo: " & HScroll1.Value & " milisegundos"
'Le colocamos el Interval al Timer, el valor de la barra (su propiedad
Value)
Timer1.Interval = HScroll1.Value
End Sub

Private Sub HScroll1_Scroll()


HScroll1_Change()
End Sub

Private Sub Timer1_Timer()


Label1.Visible = Not Label1.Visible
End Sub
End Class

Arteaga Brenda

4.-
Public Class Form1
Public x As Integer
Dim m As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

If Label1.Left < Contenedor.Left Then


m = +2
End If
If Label1.Right > Contenedor.Right Then
m = -2
End If
x = x + m
Label1.Location = New Point(x, 15)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
x = Contenedor.Right
m = 2
Label1.Location = New Point(0, 0)

End Sub
End Class
Arteaga Brenda

5.-
Public Class Form1
Dim y As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label1.Text = "HOLA"
Label1.Location = New Point(0, Contenedor.Bottom)

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer1.Tick
If Label1.Top > Contenedor.Top Then
y = y – 2

Else
y = Contenedor.Bottom
End If
Label1.Location = New Point(10, y)

End Sub

End Class

Arteaga Brenda

6.-
Public Class Form1
Public x As Integer
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
If PictureBox1.Right < Me.Right Then
x = x + 20
Else
x = Me.Left
End If
PictureBox1.Location = New Point(x, 15)
End Sub

End Class

7.-
Public Class Form1
Public x As Integer
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Static DibActual As Integer
If DibActual = 2 Then DibActual = -1
DibActual = DibActual + 1
PictureBox1.Left = PictureBox1.Left + 2
PictureBox1.Image = Leo.Images(DibActual)

End Sub

End Class
Arteaga Brenda

8.-
Public Class Form1
Public x As Integer
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
If PictureBox1.Right < Me.Right Then
x = x + 20
Else
x = Me.Left
End If
PictureBox1.Location = New Point(x, 15)
End Sub
Public z As Integer

Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick

If PictureBox1.Right < Me.Right Then


x = x + 20
Else
x = Me.Left
End If
PictureBox2.Location = New Point(x, 105)
End Sub

End Class
Arteaga Brenda

You might also like