VB6.0自编日历

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Private Sub Combo1_Click() Dim date3 As Date
Call gongyong1
Call gongyong2
Call gongyong(date3)
Call text(Weekday(date3)) End Sub
Private Sub Combo2_Click() Dim date3 As Date
Call gongyong1
Call gongyong2
Call gongyong(date3)
Call text(Weekday(date3)) End Sub
Private Sub Form_Load() Dim i As Integer
Dim j As Long
Dim h As Integer
Dim k As Integer
Dim zzz As String
Dim uu As String
Dim date2 As Date
j = 1960
For i = 0 To 150
Combo1.List(i) = j
j = j + 1
Combo1.text = Year(Date) Combo2.List(0) = "一月" Combo2.List(1) = "二月" Combo2.List(2) = "三月" Combo2.List(3) = "四月" Combo2.List(4) = "五月" Combo2.List(5) = "六月" Combo2.List(6) = "七月" Combo2.List(7) = "八月" Combo2.List(8) = "九月" Combo2.List(9) = "十月" Combo2.List(10) = "十一月" Combo2.List(11) = "十二月" Text1.text = Month(Date)
If Text1.text = 1 Then Combo2.text = "一月"
End If
If Text1.text = 2 Then Combo2.text = "二月"
End If
If Text1.text = 3 Then Combo2.text = "三月"
End If
If Text1.text = 4 Then Combo2.text = "四月"
End If
If Text1.text = 5 Then Combo2.text = "五月"
End If
If Text1.text = 6 Then Combo2.text = "六月"
End If
If Text1.text = 7 Then Combo2.text = "七月"
End If
If Text1.text = 8 Then Combo2.text = "八月"
End If
If Text1.text = 9 Then Combo2.text = "九月"
End If
If Text1.text = 10 Then Combo2.text = "十月"
If Text1.text = 11 Then
Combo2.text = "十一月"
End If
If Text1.text = 12 Then
Combo2.text = "十二月"
End If
Text6.text = Day(Date)
Text8.text = Text6.text - 1
Label1(Text8.text).BorderStyle = 1
Call gongyong(date2)
Call gongyong2
Call text(Weekday(date2))
End Sub
Private Sub Form_Unload(Cancel As Integer) End
End Sub
Private Sub Label1_Click(Index As Integer) Dim a As Integer
Dim b As Integer
Dim date2 As Date
For a = 0 To 30
Label1(a).BorderStyle = 0
Next
Label1(Index).BorderStyle = 1
Text8.text = Index
Call gongyong1
Call gongyong(date2)
Call text(Weekday(date2))
End Sub
Private Sub text(xx As String)
If xx = 1 Then
Text4.text = "星期日"
ElseIf xx = 2 Then
Text4.text = "星期一"
ElseIf xx = 3 Then
Text4.text = "星期二"
ElseIf xx = 4 Then
Text4.text = "星期三"
ElseIf xx = 5 Then
Text4.text = "星期四"
ElseIf xx = 6 Then
Text4.text = "星期五"
ElseIf xx = 7 Then
Text4.text = "星期六"
End If
End Sub
Private Sub gongyong(date1 As Date)
Dim year1, month1
year1 = Combo1.text
month1 = Text1.text
date1 = year1 + "年" + month1 + "月" + Label1(Text8.text).Caption + "日" Text3.text = date1
End Sub
Private Sub gongyong1()
If Combo2.text = "一月" Then
Text1.text = 1
End If
If Combo2.text = "二月" Then
Text1.text = 2
End If
If Combo2.text = "三月" Then
Text1.text = 3
End If
If Combo2.text = "四月" Then
Text1.text = 4
End If
If Combo2.text = "五月" Then
Text1.text = 5
End If
If Combo2.text = "六月" Then
Text1.text = 6
End If
If Combo2.text = "七月" Then
Text1.text = 7
End If
If Combo2.text = "八月" Then
Text1.text = 8
End If
If Combo2.text = "九月" Then
Text1.text = 9
End If
If Combo2.text = "十月" Then
Text1.text = 10
End If
If Combo2.text = "十一月" Then
Text1.text = 11
End If
If Combo2.text = "十二月" Then
Text1.text = 12
End If
End Sub
Private Sub gongyong2()
Dim a As String
Dim b As Integer
For i = 0 To 30
Label1(i).Visible = True
Next
If Right(CStr(Combo1.text), 2) = "00" Then If Combo1.text Mod 400 = 0 Then
Call gongyong3
If Combo2.text = "二月" Then
Label1(29).Visible = False
Label1(30).Visible = False
End If
Else: Call gongyong3
If Combo2.text = "二月" Then
Label1(28).Visible = False
Label1(29).Visible = False
Label1(30).Visible = False
End If
End If
Else
If Combo1.text Mod 4 = 0 Then
Call gongyong3
If Combo2.text = "二月" Then
Label1(29).Visible = False
Label1(30).Visible = False
End If
Else: Call gongyong3
If Combo2.text = "二月" Then
Label1(28).Visible = False
Label1(29).Visible = False
Label1(30).Visible = False
End If
End If
End If
End Sub
Private Sub gongyong3()
If Combo2.text = "四月" Or Combo2.text = "六月" Or Combo2.text = "九月" Or Combo2.text = "十一月" Then
Label1(30).Visible = False
End If
End Sub。

相关文档
最新文档