WebContainer

From Xojo Documentation

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.

Events
Closed Opening Scrolled
ContextualMenuSelected Overflowed Shown
Hidden Resized


Properties
ContextualMenu Left Parent fa-lock-32.png
ControlID fa-lock-32.png LockBottom fa-lock-32.png ScrollDirection fa-lock-32.png
Enabled LockHorizontal fa-lock-32.png Style
Height LockLeft fa-lock-32.png TabIndex
Indicator LockRight fa-lock-32.png Tooltip
LastControlIndex LockVertical fa-lock-32.png Top
LayoutDirection Name fa-lock-32.png Visible
LayoutType Page fa-lock-32.png Width


Methods
AddControl Controls GotoURL
Close EmbedWithin SetFocus
ControlAt ExecuteJavaScript UpdateBrowser
Enumerations
ScrollDirections

Notes

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. The WebContainer.ScrollDirection property controls which directions the user can scroll the WebContainer if any.

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 WebUIControl.

Sample Code

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

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

See Also

WebUIControl, WebPage, WebView