Ho una matrice di 9 command botton:
-command1(0)
-command1(1)
-command1(2)
-command1(3)
-command1(4)
-command1(5)
-command1(6)
-command1(7)
-command1(8)
-command1(9)
la caption di ogni command equivale all'indice:
ora voglio che al clic su un pulsante in una text mi apparrisse il numero corrispondente.codice:Private Sub Form_Load() Dim i As Integer For i = 0 To 9 Command1(i).Caption = i Next i End Sub
Lo so che è facile, ma non ci arrivocodice:Private Sub Command1_Click(Index As Integer) TxtQuantità.Text = TxtQuantità.Text & Command1.Caption 'così ovviamente non funziona perchè è una matrice :-( End Sub