Load Command1(i)
With Command1(i)
.Top = Command1(0).Top + i * 500
.Left = Command1(0).Left
.Caption = "第" + CStr(i) + "个装如的COMMAND控件"
.Visible = True
End With
Next i
双击command1(0)的控件,生成过程:
Private Sub Command1_Click(Index As Integer)
MsgBox "你按了第" + CStr(Index) + "个按钮!"
End Sub