dateD = datePic4.DayOfYear - datePic3.DayOfYear
dateY = datePic4.Year - datePic3.Year
If dateD = 0 Then
For fors = 0 To fore
If dateY = 0 Then
dateD = 0
Exit For
End If
If dateY = fors Then
dateD = 365 * fors
Exit For
End If
Next
dd = dateD
Else
If dateD < 0 Then
dateD = dateD + 365
ElseIf dateD > 0 Then
dateD = dateD
End If
For fors = 0 To fore
If dateY = 0 Then
dateD = dateD
Exit For
End If
If dateY = fors Then
If dateY > 1 Then
dateD = dateD + (365 * fors)
Else
dateD = dateD
End If
Exit For
End If
Next
dd = dateD
End If
TextBox7.Text = dd
dateD = datePic4.DayOfYear - datePic3.DayOfYear
If dateD < 0 Then
ck = 0
Else
ck = 1
End If
dateY = datePic4.Year - datePic3.Year
If dateD = 0 Then
For fors = 0 To fore
If dateY = 0 Then
dateD = 0
Exit For
End If
If dateY = fors Then
dateD = 365 * fors
Exit For
End If
Next
dd = dateD
Else
If dateD < 0 Then
dateD = dateD + 365
ElseIf dateD > 0 Then
dateD = dateD
End If
For fors = 0 To fore
If dateY = 0 Then
dateD = dateD
Exit For
End If
If dateY = fors Then
If dateY = 1 Then
If ck = 0 Then
dateD = dateD
Else
dateD = dateD + 365
End If
End If
If dateY > 1 Then
If ck = 0 Then
dateD = dateD + (365 * (fors - 1))
Else
dateD = dateD + (365 * fors)
End If
End If
Exit For
End If
Next
dd = dateD
End If
TextBox7.Text = dd