VB6 : Adding usercontrols using Controls.Add 
Author Message
 VB6 : Adding usercontrols using Controls.Add

I am building an explorer style application and want to be able to call any
kind of usercontrol
in a form. The main issue is that the usercontrols to be added are fully
configurable by the user.
--> I cannot include their ocx references in my main VB project.

Adding them to the form works fine using

   Dim obj As Object
   Set obj = pfrmParent.Controls.Add("MyLib.MyControl", "myCtl")
   obj.Visible = True

However as soon as I call a custom property/method of this control I get a
438 runtime error (property/method not found).

If I add this component to my project (Ctrl-T) and use exactly the same
code, It works !!
--> I think VB includes some references in the exe file to know the methods
later on.

But I cannot add it to my project because I do NOT known in advance which
ones are going to be called !
Is there a way to make this late binding really work ???



Mon, 22 Oct 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Adding UserControls to a Panel W/Autoscroll

2. Dynamically Added UserControls

3. Runtime adding/removing UserControls from container e.g PictureBox

4. Runtime adding/removing UserControls from container e.g PictureBox

5. Specify what procedure to add code to using Add-in

6. VB6 add controls plus having events for controls.

7. Adding code using Add In

8. how to add picture into table using ado code not using control

9. Adding a control to a windows form from an add-in

10. How to add code to form and controls from my Add-In

11. ? Collection add object -> usercontrol add control

12. Adding Events to Dynamically Added Controls

 

 
Powered by phpBB® Forum Software