如何响应控件数组的事件
编号:QA001734
建立日期: 1999年9月20日 最后修改日期:1999年9月20日
所属类别:
1234321:
vb5.0
win97
我创建了一个FORM又创建了两个数组Command1(0)和Command1(1)。我想要Command1(0)点击之后Form2.Show,Command1(1)点击之后Form3.Show怎样编?
回答:
当使用了控件数组后,Click事件多了一个Index参数,利用这个参数区分用户点击了哪个按钮。
Private Sub Command1_Click(ByVal Index As Integer)
If Index = 0 Then
Form2.Show
ElseIf Index = 1 Then
Form3.Show
End If
End Sub
此问题由李海回答。
| |
|
|
| |
|
|