10-09-15, 03:41 PM
سلام
موفقين
كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckDate(TextBox1.Text.Trim) Then
MsgBox("التاريخ صحيح")
Else
MsgBox("التاريخ خطا")
End If
End Sub
Private Function CheckDate(ByVal t As String) As Boolean
t = t.Trim
If t.Count = 8 Then
Dim d As String = t.Substring(0, 2) & "/" & t.Substring(2, 2) & "/" & t.Substring(4, 4)
Return IsDate(d)
End If
End Functionموفقين
متغيب
