27-04-21, 10:14 PM
السلام عليكم
حاول التالي
حاول التالي
كود :
Dim tot_d_ As String = 0
Dim tot_c_ As String = 0
Dim dif_ As String = 0
For i As Integer = 0 To DGV.Rows.Count - 1
If DGV.Rows(i).Cells(1).Value <> Nothing Then
tot_d_ = Val(tot_d_) + Val(DGV.Rows(i).Cells(4).Value)
tot_c_ = Val(tot_c_) + Val(DGV.Rows(i).Cells(5).Value)
dif_ = Val(tot_d_) - Val(tot_c_)
End If
Text_total_debit.Text = val(tot_d_)
Text_total_credit.Text = val(tot_c_)
Text_difference.Text = val(dif_)
Next