
Creating Objects at Runtime
Quote:
> I need to create an object at runtime. How can I do that?
> - Anders Feder
depends on the kind of object:
1- Instance of a class:
Project - add class - write code into it (for example 'myfunction')
create the object: dim myobj as new myclass
acess the functions(methods): myobj.myfunction...
2- automation object:
(look for 'createobject' in the online-help to create instances of
automation servers (like word, or outlook)
3- create controls at runtime:
- you cant create totally new controls at runtime, only 'clone' the
existing ones, and edit them, if they are part of an object-array. do
the following:
- create a new form
- put a control on if (for example a textbox)
- set the textboxs index-property to '0'
- write code lik this:
load text1(1)
text1(1).move 100,100
text1(1).visible = true
i hope thats it. if it isnt (this is possible, becouse i havnt my ide
with me) write again.
Sent via Deja.com http://www.deja.com/
Before you buy.