Hi,
I'm struggling with a very simple concept and I'm sure somebody here knows what I'm doing wrong. I want to programmatically create an array of mycommandbuttons in a form. I tried from Init in my form:
dimension mybuttons(30)
for x = 1 to 30
mybutton(x) = createobject(mycommandbutton)
endfor
which works just fine except it isn't attached to the form so it isn't visible. If I addobject(), my array isn't recognized because it is defined in Init(). I even tried using this.addobject without an array to dynamically create 30 different button names, but I couldn't get my parameters passed to the class, and if I dynamically create a button name I can't really access it again to change the parameters after the object is created... What am I doing wrong? Or is there a better way to do this? BTW, I do need these buttons to be created dynamically...
Thanks, Derek
I'm struggling with a very simple concept and I'm sure somebody here knows what I'm doing wrong. I want to programmatically create an array of mycommandbuttons in a form. I tried from Init in my form:
dimension mybuttons(30)
for x = 1 to 30
mybutton(x) = createobject(mycommandbutton)
endfor
which works just fine except it isn't attached to the form so it isn't visible. If I addobject(), my array isn't recognized because it is defined in Init(). I even tried using this.addobject without an array to dynamically create 30 different button names, but I couldn't get my parameters passed to the class, and if I dynamically create a button name I can't really access it again to change the parameters after the object is created... What am I doing wrong? Or is there a better way to do this? BTW, I do need these buttons to be created dynamically...
Thanks, Derek