0

こんにちは、誰でもこのエラーで1時間ほど座っているのを手伝ってもらえますか?しかし、このエラーを修正する方法がわかりません私のコードは

'Calculate the total of hours worked

'Declare a Date Time Variable   

    Dim TempDateTime As DateTime = Nothing
    'Declare a local time span variable
    Dim TempTimeSpan As New TimeSpan
    'Declare a array of type string and set the size equal to number of text boxes.
    Dim arr(6) As String
    'set the value for text boxs to array
    arr(0) = lblmontotal.Text
    arr(1) = lbltuestotal.Text
    arr(2) = lblwedtotal.Text
    arr(3) = lblthurstotal.Text
    arr(4) = lblfridtotal.Text

    For i As Integer = 0 To arr.Length - 1
        TempDateTime = CDate(arr(i))
        TempTimeSpan = TempTimeSpan.Add(New TimeSpan(TempDateTime.Hour, TempDateTime.Minute, 0))
    Next
    'showing the total time.
    lbltotalhours.Text = (TempTimeSpan.Hours & ":" & TempTimeSpan.Minutes)
4

2 に答える 2