vb控件数组如何使用,请举例说明,谢谢,
1个回答
展开全部
在窗体上添加一个Command控件,其属性Index设为0,该控件即为孔家数组。
Private Sub Command1_Click(Index As Integer)
MsgBox Command1(Index).Caption
Select Case Index
Case 0
a = a + 344
Case 1
a = a + 566
Case 2
a = a * 23
End Select
End Sub
Private Sub Form_Load()
For i = 1 To 4
Load Command1(i)
Command1(i).Top = Command1(i - 1).Top + 600
Command1(i).Visible = True
Command1(i).Caption = "Command" & (i + 1)
Next
End Sub
Private Sub Command1_Click(Index As Integer)
MsgBox Command1(Index).Caption
Select Case Index
Case 0
a = a + 344
Case 1
a = a + 566
Case 2
a = a * 23
End Select
End Sub
Private Sub Form_Load()
For i = 1 To 4
Load Command1(i)
Command1(i).Top = Command1(i - 1).Top + 600
Command1(i).Visible = True
Command1(i).Caption = "Command" & (i + 1)
Next
End Sub
追问
Select Case Index
Case 0
a = a + 344
Case 1
a = a + 566
Case 2
a = a * 23
End Select
这是什么意思?有什么用?
追答
根据Index的不同值执行不同的操作
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询