有没有大神,我先预约下,一个小时后帮我看看VB的一个东西怎么改。
求大神。
Private Sub Form_Load() Combo1.Clear Dim AA As Integer, BB As Integer AA = 2016: BB = Year(Date) '年份初值可以根据你的需要修改,终值是当年的年份 For I = AA To BB For J = 1 To 12 If I = BB And J > Month(Date) Then Exit For '当年的月份是现在的月份 For K = 1 To 31 If J = 2 And I Mod 4 = 0 And K = 30 Then Exit For '闰年是29天 If J = 2 And I Mod 4 <> 0 And K = 29 Then Exit For '非闰年是28天 If (J = 4 Or J = 6 Or J = 9 Or J = 11) And K = 31 Then Exit For '4、6、9、11是小月,只有30天 If I = BB And J = Month(Date) And K > Day(Date) Then Exit For '日期最大是当天的日期 Combo1.AddItem I & "/" & J & "/" & K Next K Next J Next I End Sub