General information
Category:
Coding, syntax & commands
Hi friend!
The Click event will tell you that man, cus this will pass the index as a parameter, let us say by example of a TextBox button:
You have a bunch of controls of the same type, say, textboxes. Each textbox has the same name as the others but each textbox has a different Index property.
Each textbox can be moved, or modified independantly of the others, but all controls in the same array use the same event code. To differentiate, the events usually have an additional parameter, index, added. For instance, you normally have a click event like:
private sub textbox1_click()
but now it's like:
private sub textbox1_click(byval index as integer)
Dim MyLastIndex as Integer
MyLastIndex = index
Msgbox "This is the last Index in my array" & str(MyLastIndex),vbInformation,App.Title
End Sub
To make a control array, you start off by putting a single textbox on your form. You then set it's index property to 0. This turns it into the first element of a control array. You then COPY the textbox and PASTE it back to the form. This puts another textbox on the form with an Index property of 1. Repeat for as many controls as you want in the array.
but the matter of your thread, I am telling u, with the Index as a parameter u can know which is the last control array index, u know, that is the magic of visual Basic, It gives u everything for u can use it with no restrictions!
Hey Friend, Dont tell anyone, but I love Visual Basic!
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only