Private Sub Command1_Click()
Dim m As Integer, n As Integer
m = Val(Text1.Text)
n = Val(Text2.Text)
For i = m To n
  If Leapyear(i) = True Then
      Label3.Caption = Label3.Caption & i & Chr(13)
End If
Next i
End Sub
Public Function Leapyear(ByVal y As Integer) As Boolean
Leapyear = False
If y Mod 4 = 0 And y Mod 100 <> 0 Or y Mod 400 = 0 Then
Leapyear = True
End If
简单的vb程序代码End Function
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
End Sub

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。