Index Control


Private Sub Form_Click()

Dim intNextIndex as Integer
IntNextIndex=CommandArray.UBound+1

Load CommandArray(IntNextIndex)

CommandArray(intNextIndex).Visible=True

CommandArray(intNextIndex).Caption=”New Button”

CommandArray(intNextIndex).Move ScaleWidth/2-

CommandArray(intNextIndex).Width /2, ScaleHeight /2-

CommandArray(intNextIndex).Height /2

End Sub

Private sub CommandArray_Click(Index as Integer)

MsgBox “You clicked button” & Index

End Sub

Note:

create 1 Form and 4 buttons

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s