Código Ejemplo:
Public Class Form1
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form2.Show()
End Sub
Private Sub botton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End
End Sub
Private Sub ApagarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End
End Sub
Private Sub ToolStripButton1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Form2.Show()
End Sub
Private Sub ToolStripButton2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
Form3.Show()
End Sub
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
Form4.Show()
End Sub
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click
End
End Sub
Private Sub CalculadoraToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculadoraToolStripMenuItem.Click
Shell("C:\WINDOWS\system32\calc.exe")
End Sub
Private Sub ApagarToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApagarToolStripMenuItem.Click
Shell("shutdown -s")
End Sub
Private Sub ReiniciarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReiniciarToolStripMenuItem.Click
Shell("shutdown -r")
End Sub
Private Sub ToolStripDropDownButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripDropDownButton1.Click
End Sub
End Class
reproductor
viernes, 16 de diciembre de 2011
jueves, 15 de diciembre de 2011
lunes, 5 de diciembre de 2011
Código Cronometro
Dim minuto As Integer
Dim segundo As Integer = 0
Dim milisegundo As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Label1.Text = hora.ToString.PadLeft(2, "0") & ":"
Label1.Text &= minuto.ToString.PadLeft(2, "0") & ":"
Label1.Text &= segundo.ToString.PadLeft(1, "0") & ":"
Label1.Text &= milisegundo.ToString.PadLeft(1, "0")
Label1.Refresh()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
milisegundo += 1
If milisegundo = 9 Then
milisegundo = 0
segundo += 1
If segundo = 59 Then
segundo = 0
minuto += 1
If minuto = 59 Then
minuto = 0
hora += 1
End If
End If
End If
Label1.Text = hora.ToString.PadLeft(2, "0") & ":"
Label1.Text &= minuto.ToString.PadLeft(2, "0") & ":"
Label1.Text &= segundo.ToString.PadLeft(2, "0") & ":"
Label1.Text &= milisegundo.ToString.PadLeft(1, "0")
Label1.Refresh()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
hora = 0
minuto = 0
segundo = 0
milisegundo = 0
Label1.Text = hora.ToString.PadLeft(2, "0") & ":"
Label1.Text &= minuto.ToString.PadLeft(2, "0") & ":"
Label1.Text &= segundo.ToString.PadLeft(2, "0") & ":"
Label1.Text &= milisegundo.ToString.PadLeft(1, "0")
Label1.Refresh()
End Sub
End Class
Dim segundo As Integer = 0
Dim milisegundo As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Label1.Text = hora.ToString.PadLeft(2, "0") & ":"
Label1.Text &= minuto.ToString.PadLeft(2, "0") & ":"
Label1.Text &= segundo.ToString.PadLeft(1, "0") & ":"
Label1.Text &= milisegundo.ToString.PadLeft(1, "0")
Label1.Refresh()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
milisegundo += 1
If milisegundo = 9 Then
milisegundo = 0
segundo += 1
If segundo = 59 Then
segundo = 0
minuto += 1
If minuto = 59 Then
minuto = 0
hora += 1
End If
End If
End If
Label1.Text = hora.ToString.PadLeft(2, "0") & ":"
Label1.Text &= minuto.ToString.PadLeft(2, "0") & ":"
Label1.Text &= segundo.ToString.PadLeft(2, "0") & ":"
Label1.Text &= milisegundo.ToString.PadLeft(1, "0")
Label1.Refresh()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
hora = 0
minuto = 0
segundo = 0
milisegundo = 0
Label1.Text = hora.ToString.PadLeft(2, "0") & ":"
Label1.Text &= minuto.ToString.PadLeft(2, "0") & ":"
Label1.Text &= segundo.ToString.PadLeft(2, "0") & ":"
Label1.Text &= milisegundo.ToString.PadLeft(1, "0")
Label1.Refresh()
End Sub
End Class
Suscribirse a:
Entradas (Atom)