Look at Load statement. Create a control of each type that you want with INDEX=0 so it is a control array. To create
Dim lngNew as Long
lngNew = controlname.Ubound + 1
Load controlname(lngNew)
controlname(lngNew).Left = ....
.....
I have used the method you mentioned in my programming before. I think the shortcoming of this method is that I must declare all types of objects iin my program, whether I use it or not. I am now working on a program like the VB IDE, in which I have almost all the VB controls there. So, I want to know that if there is a way to create the object from the very beginning.
Yes, it's a potential shortcoming. On the other hand, the alternative method - which involves CreateObject - means you miss out on being able to include specific mehtods and events for the newly created object. Swings and roundabouts.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.