I need to load some CommandButtons dymanically to the form, and I want to do some functions when clicking on the CommonButtons.
How can I program that??
Here is some of my code:
Dim cmdDynamic() As CommandButton
ReDim cmdDynamic(10) As CommandButton
i=0
for i =0 to 10
Set cmdDynamic(i) = Controls.Add("VB.CommandButton", "RandomCmd" & i)
Next i
Then, How can I know when user clicks on the Button? Any events? or Methods? that will know the user clicks the Button.
How can I program that??
Here is some of my code:
Dim cmdDynamic() As CommandButton
ReDim cmdDynamic(10) As CommandButton
i=0
for i =0 to 10
Set cmdDynamic(i) = Controls.Add("VB.CommandButton", "RandomCmd" & i)
Next i
Then, How can I know when user clicks on the Button? Any events? or Methods? that will know the user clicks the Button.