Guillo
asked on
Creating Controls in run-time
How can I create a control (any control, a textbox, a picture control, any OCX control,etc..) in runtime, from scrach?. I mean, it is possible to create a control via code?
ASKER
Thanks, Janim, i've alredy assumed that a base control was necesary but i need more information.
OK, I understand the fact to have a contron of the type i want. Then the question is:
Let's suppose i have a command button for 1 action(in this case hidden, because i want this only as a "base"). How can i create copies of this button for x actions (assume that there is a variable ammount of actions, so i don't know how many buttons they may be)?
And, It's possible to do the same with other controls (Activex OCX, data controls, etc)?
Thanks.
OK, I understand the fact to have a contron of the type i want. Then the question is:
Let's suppose i have a command button for 1 action(in this case hidden, because i want this only as a "base"). How can i create copies of this button for x actions (assume that there is a variable ammount of actions, so i don't know how many buttons they may be)?
And, It's possible to do the same with other controls (Activex OCX, data controls, etc)?
Thanks.
ASKER
Please help me, i need an answer as soon as possible.
there is a function calles 'LoadControl' in VB5, but you need an objects CLSID to use it. but look it up and try it
can you further explain your question?
by action do you mean the event corresponding to your control?
can you give me a sample algorithm of what you need to do?
by action do you mean the event corresponding to your control?
can you give me a sample algorithm of what you need to do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
I was seasrching for a general solution aplicable for all cases. And that's is!
I was seasrching for a general solution aplicable for all cases. And that's is!
if you don't want to see this initial control on you form, just set its visible property to false. you create controls using the 'load' command then make its visible property to true.