Private Sub DataGridView1_CellValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValidated
Dim sam = DataGridView1.Rows(1)
If e.RowIndex > -1 Then
For Each r As DataGridViewRow In Me.DataGridView1.Rows
If Not IsDBNull(r.Cells(6).Value) AndAlso Not IsDBNull(r.Cells(5).Value) Then
Dim sum = Convert.ToDateTime(r.Cells(6).Value) - Convert.ToDateTime(r.Cells(5).Value)
r.Cells(7).Value = sum
'cell6 timeout cel5 timenow cell7 totaltime
Else
End If
Next
End If
End Sub
Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim total As TimeSpan
For r As Integer = 0 To DataGridView1.RowCount - 1
total = total + DataGridView1.Rows(r).Cells(7).Value
Label5.Text = total.ToString
Next
End Sub