ContainerControl: What is wrong?

I defined a ContainerControl named ContainerControl1 with one label (Label1).

I try to add ContainerControl1 to a window (MyWindow) with the following instructions:

Dim MyWindow as new Window ContainerControl1.EmbedWithin(MyWindow,0,100) MyWindow.Visible = True

I get a compilation error: “There is more than one item with this name and it’s not clear to which this refers” on the second statement (ContainerControl1.EmbedWithin(MyWindow,0,100))

I don’t understand what is wrong with this…

I think you need to do this

Dim MyWindow as new Window
dim newContainer as New ContainerControl1
newContainer.EmbedWithin(MyWindow,0,100)
MyWindow.Visible = True

you need an INSTANCE of the control, not the definition of it

@Dave S Of course… It’s already too late in the evening (08:10 PM): I lose my concentration… Thank you!