|
-
Apr 5th, 2001, 09:04 AM
#1
Thread Starter
Lively Member
Hi,
I was hoping someone would be able to help me.
I am sending a UserControl Name to a function. The
function is recieveing the Name into a variant variable
called vOption.
Does anyone know how I can open the User Control
through code.
Thx
IJ
-
Apr 6th, 2001, 05:56 AM
#2
I can't test this one at the moment, but could you not use :
Code:
Dim ActX as object
Set ActX = Createobject(strconv(vOption))
Set ActX = new vOption
With ActX
.container = form1
....
type thing ?
-
Apr 10th, 2001, 03:59 PM
#3
Fanatic Member
Can't test this either. I thought you couldn't create controls with CreateObject, only new instances of classes.
-
Apr 11th, 2001, 02:21 AM
#4
Wasn't sure on this one, so needed to look it up for you, scrub that - I think you're right that you can't use the createobject option for this.
Take a look at the paragraph heading "Dynamic Control Creation" from this web site / page ... and it shows how to add it with the Controls method
Last edited by alex_read; Apr 11th, 2001 at 02:26 AM.
-
Apr 11th, 2001, 03:07 PM
#5
Fanatic Member
I have seen the light and it is good.
My god, I have been wondering how to dynamically create a control at runtime since I bought vb5. I now know that it's not possible in vb5 without heavy API usage, but vb6...this is great!!!
-
Apr 12th, 2001, 04:23 AM
#6
Francesco Balena wrote an article in VBPJ about 2 or 3 years ago about creating controls dynamically (ie: not using the Controls.Add method) that works a treat. I've it in production apps, had not problems
- gaffa
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|