Please i need help in leap year. My problem is, all of the month has a date of 1-31, except for feb. after i choose feb, as my month ( i'm using combo box ) , it removes the date from 29-31, and if i choose a leap year, it adds 29 to the day, my problem is when i select a different year, or month, it doesn't add the day 29-31.
here is my code.
Private Sub yearBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles yearBox.SelectedIndexChanged
If monthBox.SelectedIndex = 1 Then
If IsNumeric(yearBox.Text) Then
If Int(yearBox.Text) > 1950 And Int(yearBox.Text) < 1996 Then
If Date.IsLeapYear(Int(yearBox.Text)) Then
dayBox.Items.Add("29")
End If
End If
End If
End If
End Sub
Private Sub monthBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles monthBox.SelectedIndexChanged
If monthBox.SelectedIndex = 1 Then
dayBox.Items.Remove("29")
dayBox.Items.Remove("30")
dayBox.Items.Remove("31")
End If
End Sub
End Class
Thank you in advance.