Ultima modifica da un moderatore:
Ecco a voi il Source del mio Cronometro...
Codice:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = Date.Now
Process.Start("http://forum.pescatoridelweb.altervista.org/forum/")
End Sub
Private Sub timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim seconds As Integer = Cronometro.Text.Substring(3, 2)
Dim minutes As Integer = Cronometro.Text.Substring(0, 2)
If seconds Mod 59 = 0 And seconds > 0 Then
minutes += 1
Cronometro.Text = Format(minutes, "00") & ":00"
Else
seconds += 1
Cronometro.Text = Format(minutes, "00") & ":" & Format(seconds, "00")
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Button1.Text = "Start" Then
Timer1.Enabled = True
Label2.Text = "Ora Inizio:" & " " & TimeOfDay.Hour & ":" & TimeOfDay.Minute & ":" & TimeOfDay.Second
Button1.Text = "Stop"
Else
Timer1.Enabled = False
Label3.Text = "Ora Stop:" & " " & TimeOfDay.Hour & ":" & TimeOfDay.Minute & ":" & TimeOfDay.Second
Label4.Text = "Tempo Trascorso:" & " " & Cronometro.Text
Cronometro.Text = "00:00"
Button1.Text = "Start"
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Button1.Text <> "Start" Then
MsgBox("Attezione! Ferma il cronometro.", MsgBoxStyle.Critical)
Exit Sub
End If
Label2.Text = "START"
Label3.Text = "STOP"
Label4.Text = "TEMPO TRASCORSO"
Cronometro.Text = "00:00"
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Label1.Text = Date.Now
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Process.Start("http://forum.pescatoridelweb.altervista.org/forum/")
End Sub
End Class