简单万年历

采用vb im d As Integer Dim vHour%, vState$ Dim Tim As String, b As Long, H As Integer, M As Integer, S As Long Private Sub Command1_Click() S = fun(Month(Now), Year(Now)) End Sub Private Sub Command2_Click() End Sub Private Sub Command3_Click() If Val(Text1.Text) > 11 Then Text1.Text = 0 Text2.Text = Val(Text2.Text) + 1 End If Text1.Text = Val(Text1.Text) + 1 S = fun(Val(Text1.Text), Val(Text2.Text)) End Sub Private Sub Command4_Click() If Val(Text1.Text) < 2 Then Text1.Text = 13 Text2.Text = Val(Text2.Text) - 1 End If Text1.Text = Val(Text1.Text) - 1 S = fun(Val(Text1.Text), Val(Text2.Text)) End Sub Private Sub Command5_Click() If Val(Text2.Text) < 0 Then MsgBox "不能为负年", 64, "通知" End If Text2.Text = Val(Text2.Text) + 1 Text1.Text = Val(Text1.Text) S = fun(Val(Text1.Text), Val(Text2.Text)) End Sub Private Sub Command6_Click() Text2.Text = Val(Text2.Text) - 1 Text1.Text = Val(Text1.Text) S = fun(Val(Text1.Text), Val(Text2.Text)) End Sub Private Sub Form_Load() Tim = Timer1.Interval = 100 Text2.Text = Year(Now) Text1.Text = Month(Now) End Sub Private Sub Picture1_Click() MsgBox "美女漂亮吧", 64, "美女" End Sub Private Sub Text1_DblClick() If Val(Text1.Text) > 12 Or Val(Text1.Text) < 1 Then MsgBox "月份不在范围内", 64, "提示" Exit Sub End If End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then KeyAscii = 0 If Text1.Text > 0 And Text1.Text < 13 Then S = fun(Text1.Text, Text2.Text) Else日历.Cls MsgBox "月份不在范围内", 64, "提示" Exit Sub End If End Sub Private Sub Text2_DblClick() If Val(Text2.Text) < 1 Then MsgBox "年份份不在范围内", 64, "提示" Exit Sub End If S = fun(Text1.Text, Text2.Text) End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then KeyAscii = 0 If Text2.Text > 0 Then S = fun(Text1.Text, Text2.Text) Else日历.Cls MsgBox "月份不在范围内", 64, "提示" Exit Sub End If End Sub
exe 文件大小:376KB