J
jbw
i am trying to get a value of true if a user of my program selects a leap
year from a combobox.
can someone help me to correct this code so that i can do this using a
simple loop, rather than having to write a list 100 years long?
here is the code that i am trying to work with using vb.net
Private Sub yearBox_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles yearBox.SelectedIndexChanged
Dim lYear As Boolean
Dim x As Integer
Dim leap As Short
x = 3
For x = 3 To 115
If x + 4 = yearBox.SelectedIndex Then
lYear = True
Else : lYear = False
End If
totaldaysbox.Text = lYear
Next x
End Sub
year from a combobox.
can someone help me to correct this code so that i can do this using a
simple loop, rather than having to write a list 100 years long?
here is the code that i am trying to work with using vb.net
Private Sub yearBox_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles yearBox.SelectedIndexChanged
Dim lYear As Boolean
Dim x As Integer
Dim leap As Short
x = 3
For x = 3 To 115
If x + 4 = yearBox.SelectedIndex Then
lYear = True
Else : lYear = False
End If
totaldaysbox.Text = lYear
Next x
End Sub