VB设计程序:编程完成下面功能:在窗体上设置2文本框,要求在文本框Text1中输入一个0~6的整数

VB设计程序:编程完成下面功能:在窗体上设置2文本框,要求在文本框Text1中输入一个0~6的整数,然后单机窗体,则在文本框Text2中用英文显示是星期几。太谢谢!

Private Sub Form_Click()
    Dim n As Integer
    If IsNumeric(Text1.Text) Then
        n = Val(Text1.Text)
        Select Case n
            Case 0
                Text2.Text = "Sunday"
            Case 1
                Text2.Text = "Monday"
            Case 2
                Text2.Text = "Tuesday"
            Case 3
                Text2.Text = "Wednesday"
            Case 4
                Text2.Text = "Thursday"
            Case 5
                Text2.Text = "Friday"
            Case 6
                Text2.Text = "Saturday"
            Case Else
                MsgBox "请输入数字0-6"
        End Select
    Else
        MsgBox "请输入数字0-6"
    End If
End Sub

追答

不好意思,星期用了中文,现已改为英文

追问

谢谢!请问改之后的哪里看呢

追答

用PC可以看到

追问

好的,谢谢!

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