I want the exact same effect but this time without an abject being part of an array. Example: Intead of load Text1(1), I would load Text2. Is this possible, if so, HOW?
Will not work by itself. If you need to use Text2's reference, It does not work. The first example is the one to follow! So when you want to set Visible to true or it's size and position, The Set Var = methode is the best.
Re: [RESOLVED] Create an object durring runtime in code
You are welcome.
I didn't know. I would have expected, after Controls.Add "VB.TextBox", "Text2", you could use Text2.Visisble or whatever throughout your code, but come to think of it, that is not possible. Text2 ist not known to the compiler at compile time, so it cannot build references to it. The object comes in by late binding during runtime. So you must care to keep a reference to it, like t1, to keep references to it working, because its name is but a string and not evaluated at compile time.
Good job to clear that.
Bookmarks