VB求大神帮助~! :编程完成下面功能:在窗体上设置2文本框,要求在文本框Text1中输入一个0~

2024-12-17 05:13:31
推荐回答(2个)
回答1:

完整代码如下:
Option Explicit

Private Sub Form_Click()
Dim n As Integer
n = Val(Text1.Text)

Select Case n
Case 1
Text2.Text = "星期一"
Case 2
Text2.Text = "星期二"
Case 3
Text2.Text = "星期三"
Case 4
Text2.Text = "星期四"
Case 5
Text2.Text = "星期五"
Case 6
Text2.Text = "星期六"
Case 7
Text2.Text = "星期日"
Case Else
Text2.Text = "输入错误!"
End Select

End Sub

回答2:

if text1.text="0"then
text2.text="星期天的英文"
elseif ...
elseif...
...
end if