From Xojo Documentation

For desktop applications, see ContainerControl.

Class (inherits from WebView)

New in 2010r4

A WebContainer is a way to create a group of controls that are treated as a single control. A WebContainer is a great way to simplify complex web page layouts. In addition, with a WebContainer, you can create reusable controls to include on multiple web pages or on other web containers.

Close Hidden MouseMove
ContentsScrolled KeyPressed MouseUp
ContextualMenuAction LostFocus Open
DoubleClick MouseDown Resized
DropObject MouseEnter Shown
GotFocus MouseExit

ContextualMenu Left Style
ControlID fa-lock-32.png LockBottom Top
Cursor LockHorizontal VerticalCenter
DragOverStyle LockLeft Visible
Enabled LockRight Width
Height LockTop Zindex
HelpTag LockVertical
HorizontalCenter ScrollbarsVisible

AcceptPictureDrop ControlAtIndex MsgBox
AcceptRawDataDrop ControlCount PresentContextualMenu
AcceptTextDrop ControlWithId ScrollTo
AllowPictureDrag ControlWithName SetFocus
AllowRawDataDrag ControlsWithName ShowURL
AllowTextDrag EmbedWithin
Close ExecuteJavaScript


This class is useful for creating reusable sets of controls. Itʼs also useful for creating scrollable views. You can create a scrollable view by creating a WebContainer and then after placing it on a webpage or other WebContainer, make the WebContainer on the page smaller than it would normally appear. This will cause scrollbars to automatically be added. You can control this scrollbar behavior via the ScrollbarsVisible property.

You can also use a WebContainer to center your page contents in the browser window. To do so, put all your controls on a WebContainer and then add the WebContainer to a WebPage. For the properties of the WebContainer, select LockVertical and LockHorizontal to ensure that the WebContainer always stays centered in the page displayed in the browser.

WebContainers can only contain controls that are subclasses of WebControl.


This code adds a WebContainer, called LoginContainer, to a web page at run-time:

Var login As New LoginContainer
login.EmbedWithin(Self, 0, 0, login.Width, login.Height)

See Also

WebControl, WebPage, WebView