From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

ContainerControl.EmbedWithinPanel(ContainingPanel as PagePanel, Page as Integer, [left as Integer, top as Integer, width as Integer, height as Integer])

Supported for all project types and targets.

Embeds the ContainerControl on a page in the passed PagePanel or TabPanel.


An instance of a ContainerControl can only be embedded into one page.

The ContainerControl is embedded on the passed page and the containing control is the parent of the ContainerControl. The optional Left and Top parameters determine the location of the top-left corner, relative to the containing control, not the parent window. If the ContainerControl itself has Left and Top values (not typical as they default to 0) then they are added to what is specified here. The optional parameters Width and Height determine the size of the ContainerControl.

Sample Code

This example adds a new tab to a TabPanel and then add a ContainerControl to it:

MainTab.AddPanel("New Tab")
Var tabNum As Integer
tabNum = MainTab.PanelCount - 1

Var cc As New MyContainer
cc.EmbedWithinPanel(MainTab, tabNum)