CompuServe Messages

#Ctl Array Creation BUG

    14-Oct-91 13:53:57
Sb: #Ctl Array Creation BUG
Fm: Keith Funk/Vanc.BC,CAN. 72240,2020
To: Don Funk 76701,155
Hi Don, I don't know if this bug has been reported yet. If you create a control and add code to one of its events and then decide to make it into a control array, VB does not add the Index As Integer argument to the control's argument list. When you attempt to run the program, VB gives the error, "Incorrect number of event procedure arguments". To duplicate the problem. 1. Add two command buttons named Command1 and Command2 to a Form. 2. In the Command1_Click event add the code: Print "hello" 3. Change the CtlName of Command2 to Command1. Answer Yes when asked if you want to create a control array. 4. Look at the Command1_Click event. Index As Integer has not been added to the event's argument list. 5. Try running the program. VB will give the error, "Incorrect number of event procedure arguments." I ran across this problem some time ago and couldn't figure out what was going on. It was Dan Appleman that explained the problem and how to duplicate it. KeithF There are 2 Replies.