本人菜鸟,想在PPT里用VB做一个随机点名程序,一个开始按钮,一个结束按钮,如何实现
代码如下:PrivateSubCommandButton1_Click()b=Truexsh1:Fora=1To5DoEventsSelectCaseaCase1Text...
代码如下:
Private Sub CommandButton1_Click()
b = True
xsh1:
For a = 1 To 5
DoEvents
Select Case a
Case 1
TextBox1.Text = "丁"
Case 2
TextBox1.Text = "王"
Case 3
TextBox1.Text = "邓"
Case 4
TextBox1.Text = "冯"
Case 5
TextBox1.Text = "孙"
End Select
If b = False Then Exit Sub
Next
If b = True Then GoTo xsh1
End Sub
Private Sub CommandButton2_Click()
b = False
End Sub
结束按钮没作用!怎么修改? 展开
Private Sub CommandButton1_Click()
b = True
xsh1:
For a = 1 To 5
DoEvents
Select Case a
Case 1
TextBox1.Text = "丁"
Case 2
TextBox1.Text = "王"
Case 3
TextBox1.Text = "邓"
Case 4
TextBox1.Text = "冯"
Case 5
TextBox1.Text = "孙"
End Select
If b = False Then Exit Sub
Next
If b = True Then GoTo xsh1
End Sub
Private Sub CommandButton2_Click()
b = False
End Sub
结束按钮没作用!怎么修改? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询