vb编写程序,输入年月,输出该月对应的天数的代码 要求用 select case 实现

如题所述

Private Sub Command1_Click()
Dim myMonth As Integer
Dim myYear As Integer
myYear = Val(Text1.Text)
myMonth = Val(Text2.Text)
Text3.Text = DateDiff("d", myYear & "-" & myMonth & "-" & "1", myYear & "-" & myMonth + 1 & "-" & "1")
End Sub
Private Sub Form_Load()
Text1.Text = Year(Date) 'text1中输入年份
Text2.Text = 1 'text2中输入月份
Text3.Text = "" 'text3中输入月份对应的天数
Command1.Caption = "查看"
End Sub

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答