14-04-13, 03:45 PM
السلام عليكم
- هذا كود آخر . ضعه في كود الزر :
- تحياتي .
- هذا كود آخر . ضعه في كود الزر :
كود :
Dim StartTime As Date
Dim EndTime As Date
Dim H As Integer
Dim M As Integer
StartTime = Format$(Text1.Text, "HH:MM:SS")
EndTime = Format$(Text2.Text, "HH:MM:SS")
Minutes = DateDiff("n", StartTime, EndTime)
If Minutes < 0 Then
Dim T As Integer
Dim tTime As Date
Do
T = T + 1
tTime = DateAdd("n", T, StartTime)
If Format$(tTime, "HH:MM:SS") = Format$(EndTime, "HH:MM:SS") Then
H = Int(T / 60)
M = T Mod 60
Text3.Text = Format$(H, "00") & ":" & Format$(M, "00")
Exit Sub
End If
Loop
Else
H = Int(Minutes / 60)
M = Minutes Mod 60
Text3.Text = Format$(H, "00") & ":" & Format$(M, "00")
End If- تحياتي .

