Side-bySide(regfree) problem with dynamic add control

73 views Asked by At

We migrate our vb6 project to use sidebyside(regfree) tehnology ....but have problem with dynamic add control to form like:

Private WithEvents tmpCtl As VBControlExtender

Private Sub UserControl_Initialize()
Set tmpCtl = Controls.Add("Project2.UserControl1", "ctl")
  With tmpCtl
    Set .Container = Me
    .Visible = True
  End With
End Sub

and when use tmpCtl object like:

tmpCtl.Properties

we got error "object doesn't support this property or method"

I found that people have like same problem (Strange Case of the missing method: SXS and Controls.Add results in "object doesn't support this property or method"?) and suggestion is implement "Direct user control".

Can somebody know how implement this in vb6 code? How we can fix problem with sxs and dynamic add control to form?

Can give us same example of solution how solve this problem?

0

There are 0 answers