跪求一个vb的日历程序,界面做成这样的,非常感谢 下次有分了补上_百度...
发布网友
发布时间:2024-10-01 18:18
我来回答
共1个回答
热心网友
时间:2024-10-18 14:57
给你个简便易行的代码。
==========================
Private Sub Form_Load()
While 1
Dim y As Integer, m As Integer, d As Integer, s As Date, x As Integer, r As String
y = InputBox("请输入年份", , Format(Now, "yyyy"))
m = InputBox("请输入月份", , Format(Now, "mm"))
d = InputBox("请输入日期", , Format(Now, "dd"))
s = DateSerial(y, m, d)
x = Weekday(s)
Select Case x
Case 1
r = "日"
Case 2
r = "一"
Case 3
r = "二"
Case 4
r = "三"
Case 5
r = "四"
Case 6
r = "五"
Case 7
r = "六"
End Select
MsgBox "星期" & r
Wend
End Sub
热心网友
时间:2024-10-18 14:53
给你个简便易行的代码。
==========================
Private Sub Form_Load()
While 1
Dim y As Integer, m As Integer, d As Integer, s As Date, x As Integer, r As String
y = InputBox("请输入年份", , Format(Now, "yyyy"))
m = InputBox("请输入月份", , Format(Now, "mm"))
d = InputBox("请输入日期", , Format(Now, "dd"))
s = DateSerial(y, m, d)
x = Weekday(s)
Select Case x
Case 1
r = "日"
Case 2
r = "一"
Case 3
r = "二"
Case 4
r = "三"
Case 5
r = "四"
Case 6
r = "五"
Case 7
r = "六"
End Select
MsgBox "星期" & r
Wend
End Sub