(10分) 救命! 識 Visual basic 快入泥!!! Arrays 問題!!!

2007-09-12 6:27 am
如果我有2個cmdbutton (eg: command(1), command(2) )
我可以點樣獨立code 佢地???\\
姐係我想command(1) 做a,
command(2) 做b....

最好俾code 我

回答 (1)

2007-09-12 8:14 am
✔ 最佳答案
Spot the difference:

When the command button is not an array
Private Sub Command1_Click()

End Sub

When the command button is an array
Private Sub Command1_Click(Index As Integer)

End Sub

Do it like this
Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
' Do a
ElseIf Index = 1 Then
' Do b
End If
End Sub


收錄日期: 2021-04-25 20:33:16
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070911000051KK04524

檢視 Wayback Machine 備份