Hey
people wonder if some 1 can help me maybe this is my code am doing a VB.NET course and assignment it says to build a stop watch so i have but i am having a problem with 1 line this line :-
This is my code
can any see a correction and maybe give me a simple solution
i appreciate it a lot thanks
people wonder if some 1 can help me maybe this is my code am doing a VB.NET course and assignment it says to build a stop watch so i have but i am having a problem with 1 line this line :-
VB.NET:
ElapsedTime = DateDiff(DateInterval.Second, StartTime, EndTime)
This is my code
VB.NET:
Dim StartTime As Date
Dim EndTime As Date
Dim ElapsedTime As Date
Private Sub frmStopWatch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btnstart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstart.Click
'Establish and print starting time
StartTime = Now
lblstart.Text = Format(StartTime, "hh:mm:ss")
lblEnd.Text = ""
lblElapsed.Text = ""
End Sub
Private Sub btnEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnd.Click
'Find the ending time, compute the elapsed time
'put both values in lable boxes
EndTime = Now
[COLOR="Blue"]ElapsedTime = DateDiff(DateInterval.Second, StartTime, EndTime)[/COLOR]
lblEnd.Text = Format(EndTime, "hh:mm:ss")
lblElapsed.Text = Format(ElapsedTime, "0")
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
can any see a correction and maybe give me a simple solution
i appreciate it a lot thanks