[Message Deleted]
-
Hi there, If you add the calendar control into the form, and from there, you can tell if that is a leap year or not. I may be wrong but I think the calendar control class will return some boolean that states wherether select year is a leap year such as Messagebox.show(ctrCalendar.selectedate.Isleapyear) Good luck
-
Hi there, If you add the calendar control into the form, and from there, you can tell if that is a leap year or not. I may be wrong but I think the calendar control class will return some boolean that states wherether select year is a leap year such as Messagebox.show(ctrCalendar.selectedate.Isleapyear) Good luck
-
You can use the modulo operator to find out if a number is divisible by another. The expression
x mod y
returns zero if x is divisible by y. That should be enough to get you started. :)--- b { font-weight: normal; }
I have something but it's not quite right, because years ending with 00 before de decimal are not leap years (example 1700 1800 1900 or even 2000000 as long as it has 00) I don't know how to do that. Also thanks for your help Guffa. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As Integer y = TextBox1.Text If y Mod 4 = 0 Then TextBox2.Text = "is leap" ElseIf y Mod 400 = 0 Then TextBox2.Text = "is leap" Else TextBox2.Text = "isn't leap" End If End Sub
-
I have something but it's not quite right, because years ending with 00 before de decimal are not leap years (example 1700 1800 1900 or even 2000000 as long as it has 00) I don't know how to do that. Also thanks for your help Guffa. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As Integer y = TextBox1.Text If y Mod 4 = 0 Then TextBox2.Text = "is leap" ElseIf y Mod 400 = 0 Then TextBox2.Text = "is leap" Else TextBox2.Text = "isn't leap" End If End Sub