那位大侠能帮我答这份卷子 是VB的程序补充

来源:百度知道 编辑:UC知道 时间:2024/05/31 06:54:52
三. 补充程序 (10分)
1.窗体上有一个文本框,一个命令按钮数组,含两个命令按钮,单击第一个命令按钮时,文本框输出“第一次计数”,单击第二个命令按钮时,文本框输出“第二次计数”,补充下面程序。
Private Sub Command1_Click (Index As Integer)
Select Case
Case 1
Text1.Text=”第二次计数”
Case 0
Text1.Text=”第一次计数”
End Select
End Sub
2. 窗体上一个单选按钮数组Option1(), 含三个单选按钮,有一个命令按钮,要求程序运行时,如果选中一个单选按钮,并单击命令按钮,在窗体上显示相应的信息。补充程序:
Private Sub Command_Click()
For i= to
If Option1(i). =True Then
Print “您选择了”+Option1(i).
End If
Next
End Sub

第一题
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 1
Text1.Text = "第二次计数"
Case 0
Text1.Text = "第一次计数"
End Select
End Sub

第二题

Private Sub Command1_Click()
For i = 0 To 2
If Option1(i) = True Then
Print "您选择了" & "Option1(" & i & ")"
End If
Next
End Sub