编一VB程序,输入一个数字(1~7),用英文显示对应的星期一至星期日
3个回答
展开全部
Private Sub text1_Change()
if text1.text="1" then
print "Monday"
else
if text1.text="2" then
print "Tuesday"
else
if text1.text="3" then
print "Wednesday"
else
if text1.text="4" then
print "Thursday"
else
if text1.text="5" then
print "Friday"
else
if text1.text="6" then
print "Saturday"
else
if text1.text="7" then
print "Sunday"
end if
end if
end if
end if
end if
end if
end if
End Sub
Private Sub Form_Load()
Text1.MaxLength = "1"
End Sub
if text1.text="1" then
print "Monday"
else
if text1.text="2" then
print "Tuesday"
else
if text1.text="3" then
print "Wednesday"
else
if text1.text="4" then
print "Thursday"
else
if text1.text="5" then
print "Friday"
else
if text1.text="6" then
print "Saturday"
else
if text1.text="7" then
print "Sunday"
end if
end if
end if
end if
end if
end if
end if
End Sub
Private Sub Form_Load()
Text1.MaxLength = "1"
End Sub
展开全部
Private Sub Form_click()
Dim ww As String
ww = InputBox("输入数字1-7")
Select Case ww
Case "1"
MsgBox ("Monday")
Case "2"
MsgBox ("Tuesday")
Case "3"
MsgBox ("Wednesday")
Case "4"
MsgBox ("Thursday")
Case "5"
MsgBox ("Friday")
Case "6"
MsgBox ("Saturday")
Case "7"
MsgBox ("Sunday")
End Select
End Sub
Dim ww As String
ww = InputBox("输入数字1-7")
Select Case ww
Case "1"
MsgBox ("Monday")
Case "2"
MsgBox ("Tuesday")
Case "3"
MsgBox ("Wednesday")
Case "4"
MsgBox ("Thursday")
Case "5"
MsgBox ("Friday")
Case "6"
MsgBox ("Saturday")
Case "7"
MsgBox ("Sunday")
End Select
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select
case
a
=
text1
改为
a
=
text1.text
select
case
a
case
a
=
text1
改为
a
=
text1.text
select
case
a
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询