在名称为Form1,标题为“输入3个Q结束输入”的窗体上,画三个文本框,名称为Text1、Text2、Text3初始内容
答案:1 悬赏:70
解决时间 2021-02-10 07:13
- 提问者网友:浪子生来ˇ性放荡²↘
- 2021-02-10 01:40
在名称为Form1,标题为“输入3个Q结束输入”的窗体上,画三个文本框,名称为Text1、Text2、Text3初始内容
最佳答案
- 二级知识专家网友:情战辞言
- 2021-02-10 02:12
Private Sub C1_Click()
Dim s(10)
Text1 = 0
Text2 = 0
Text3 = 0
For i = 1 To 10
Do
s(i) = InputBox("输入第" & i & "个任意字母")
Loop Until Len(s(i)) = 1 And UCase(s(i)) >= "A" And UCase(s(i)) <= "Z"
If i >= 3 Then If UCase(s(i)) & UCase(s(i - 1)) & UCase(s(i - 2)) = "QQQ" Then Exit For
If UCase(s(i)) = "A" Then
Text1 = Val(Text1) + 1
ElseIf UCase(s(i)) = "B" Then
Text2 = Val(Text2) + 1
ElseIf UCase(s(i)) = "C" Then
Text3 = Val(Text3) + 1
End If
Next
End Sub
Private Sub C2_Click()
Text1 = "'"
Text2 = ""
Text3 = ""
C1.SetFocus
End Sub
Private Sub C3_Click()
Unload Me
End Sub更正,倒数第8行改为
Text1 = ""
Dim s(10)
Text1 = 0
Text2 = 0
Text3 = 0
For i = 1 To 10
Do
s(i) = InputBox("输入第" & i & "个任意字母")
Loop Until Len(s(i)) = 1 And UCase(s(i)) >= "A" And UCase(s(i)) <= "Z"
If i >= 3 Then If UCase(s(i)) & UCase(s(i - 1)) & UCase(s(i - 2)) = "QQQ" Then Exit For
If UCase(s(i)) = "A" Then
Text1 = Val(Text1) + 1
ElseIf UCase(s(i)) = "B" Then
Text2 = Val(Text2) + 1
ElseIf UCase(s(i)) = "C" Then
Text3 = Val(Text3) + 1
End If
Next
End Sub
Private Sub C2_Click()
Text1 = "'"
Text2 = ""
Text3 = ""
C1.SetFocus
End Sub
Private Sub C3_Click()
Unload Me
End Sub更正,倒数第8行改为
Text1 = ""
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯