Class

# WebContainer

<div class="rst-class">

forsearch

</div>

Popover

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A <span class="title-ref">WebContainer</span> is a way to create a group of controls that are treated as a single control. A <span class="title-ref">WebContainer</span> is a great way to simplify complex web page layouts. In addition, with a <span class="title-ref">WebContainer</span>, you can create reusable controls to include on multiple web pages or on other web containers.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                            | Type                                                 | Read-Only | Shared |
|-------------------------------------------------|------------------------------------------------------|-----------|--------|
| `ContextualMenu<webcontainer.contextualmenu>`   | `WebMenuItem</api/user_interface/web/webmenuitem>`   |           |        |
| `ControlCount<webcontainer.controlcount>`       | `Integer</api/data_types/integer>`                   | ✓         |        |
| `ControlID<webcontainer.controlid>`             | `String</api/data_types/string>`                     | ✓         |        |
| `Enabled<webcontainer.enabled>`                 | `Boolean</api/data_types/boolean>`                   |           |        |
| `Height<webcontainer.height>`                   | `Integer</api/data_types/integer>`                   |           |        |
| `Indicator<webcontainer.indicator>`             | `Indicators<webuicontrol.indicators>`                |           |        |
| `LayoutDirection<webcontainer.layoutdirection>` | `WebView.LayoutDirections<webview.layoutdirections>` |           |        |
| `LayoutType<webcontainer.layouttype>`           | `WebView.LayoutTypes<webview.layouttypes>`           |           |        |
| `Left<webcontainer.left>`                       | `Integer</api/data_types/integer>`                   |           |        |
| `LockBottom<webcontainer.lockbottom>`           | `Boolean</api/data_types/boolean>`                   |           |        |
| `LockHorizontal<webcontainer.lockhorizontal>`   | `Boolean</api/data_types/boolean>`                   |           |        |
| `LockLeft<webcontainer.lockleft>`               | `Boolean</api/data_types/boolean>`                   |           |        |
| `LockRight<webcontainer.lockright>`             | `Boolean</api/data_types/boolean>`                   |           |        |
| `LockTop<webcontainer.locktop>`                 | `Boolean</api/data_types/boolean>`                   |           |        |
| `LockVertical<webcontainer.lockvertical>`       | `Boolean</api/data_types/boolean>`                   |           |        |
| `Name<webcontainer.name>`                       | `String</api/data_types/string>`                     | ✓         |        |
| `Page<webcontainer.page>`                       | `WebPage</api/user_interface/web/webpage>`           | ✓         |        |
| `PanelIndex<webcontainer.panelindex>`           | `Integer</api/data_types/integer>`                   |           |        |
| `Parent<webcontainer.parent>`                   | `WebView</api/user_interface/web/webview>`           | ✓         |        |
| `ScrollDirection<webcontainer.scrolldirection>` | `ScrollDirections<webcontainer.scrolldirections>`    | ✓         |        |
| `ScrollPosition<webcontainer.scrollposition>`   | `Point</api/graphics/point>`                         |           |        |
| `TabIndex<webcontainer.tabindex>`               | `Integer</api/data_types/integer>`                   |           |        |
| `Tooltip<webcontainer.tooltip>`                 | `WebToolTip</api/user_interface/web/webtooltip>`     |           |        |
| `Top<webcontainer.top>`                         | `Integer</api/data_types/integer>`                   |           |        |
| `Visible<webcontainer.visible>`                 | `Boolean</api/data_types/boolean>`                   |           |        |
| `Width<webcontainer.width>`                     | `Integer</api/data_types/integer>`                   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                | Parameters                                                                                                                                                                                                                                                                                               | Returns                                          | Shared |
|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|--------|
| `AcceptPictureDrop<webcontainer.acceptpicturedrop>` | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`                                                                                                                                                            |                                                  |        |
| `AcceptRawDataDrop<webcontainer.acceptrawdatadrop>` | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`                                                                                                                                                            |                                                  |        |
| `AcceptTextDrop<webcontainer.accepttextdrop>`       | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`                                                                                                                                                            |                                                  |        |
| `AddControl<webcontainer.addcontrol>`               | Child As `WebControl</api/user_interface/web/webcontrol>`                                                                                                                                                                                                                                                |                                                  |        |
| `AllowPictureDrag<webcontainer.allowpicturedrag>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`                                                                                                                                                            |                                                  |        |
| `AllowRawDataDrag<webcontainer.allowrawdatadrag>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`                                                                                                                                                            |                                                  |        |
| `AllowTextDrag<webcontainer.allowtextdrag>`         | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`                                                                                                                                                            |                                                  |        |
| `Close<webcontainer.close>`                         |                                                                                                                                                                                                                                                                                                          |                                                  |        |
| `ControlAt<webcontainer.controlat>`                 | index As `Integer</api/data_types/integer>`                                                                                                                                                                                                                                                              | `WebControl</api/user_interface/web/webcontrol>` |        |
| `Controls<webcontainer.controls>`                   |                                                                                                                                                                                                                                                                                                          | `Iterable</api/language/iterable>`               |        |
| `EmbedWithin<webcontainer.embedwithin>`             | View As `WebView</api/user_interface/web/webview>`, Width As `Integer</api/data_types/integer>`, Height As `Integer</api/data_types/integer>`                                                                                                                                                            |                                                  |        |
|                                                     | View As `WebView</api/user_interface/web/webview>`, X As `Integer</api/data_types/integer>`, Y As `Integer</api/data_types/integer>`, Width As `Integer</api/data_types/integer>`, Height As `Integer</api/data_types/integer>`                                                                          |                                                  |        |
| `ExecuteJavaScript<webcontainer.executejavascript>` | script As `String</api/data_types/string>`                                                                                                                                                                                                                                                               |                                                  |        |
| `GotoURL<webcontainer.gotourl>`                     | url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                                                                                                                                                                                |                                                  |        |
| `LastControlIndex<webcontainer.lastcontrolindex>`   |                                                                                                                                                                                                                                                                                                          | `Integer</api/data_types/integer>`               |        |
| `Objects<webcontainer.objects>`                     |                                                                                                                                                                                                                                                                                                          | `Iterable</api/language/iterable>`               |        |
| `RemoveControl<webcontainer.removecontrol>`         | control As `WebUIControl</api/user_interface/web/webuicontrol>`                                                                                                                                                                                                                                          |                                                  |        |
| `SetFocus<webcontainer.setfocus>`                   |                                                                                                                                                                                                                                                                                                          |                                                  |        |
| `ShowPopover<webcontainer.showpopover>`             | parentControl As `WebUIControl</api/user_interface/web/webuicontrol>`, displaySide As `WebContainer.DisplaySides<webcontainer.displaysides>` = `WebContainer.DisplaySides<webcontainer.displaysides>`.Bottom, x As `Integer</api/data_types/integer>` = -1, y As `Integer</api/data_types/integer>` = -1 |                                                  |        |
| `Style<webcontainer.style>`                         |                                                                                                                                                                                                                                                                                                          | `WebStyle</api/user_interface/web/webstyle>`     |        |
|                                                     | `Assigns</api/language/assigns>` value As `WebStyle</api/user_interface/web/webstyle>`                                                                                                                                                                                                                   |                                                  |        |
| `UpdateBrowser<webcontainer.updatebrowser>`         |                                                                                                                                                                                                                                                                                                          |                                                  |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                          | Parameters                                                                                                                                                                                                        | Returns |
|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `Closed<webcontainer.closed>`                                 |                                                                                                                                                                                                                   |         |
| `ContextualMenuSelected<webcontainer.contextualmenuselected>` | hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`                                                                                                                                                     |         |
| `DropObject<webcontainer.dropobject>`                         | obj As `WebDragItem</api/user_interface/web/webdragitem>`, action As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>` |         |
| `Hidden<webcontainer.hidden>`                                 |                                                                                                                                                                                                                   |         |
| `Opening<webcontainer.opening>`                               |                                                                                                                                                                                                                   |         |
| `Overflowed<webcontainer.overflowed>`                         | width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`                                                                                                                         |         |
| `Pressed<webcontainer.pressed>`                               | x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`                                                                                                                                  |         |
| `Resized<webcontainer.resized>`                               |                                                                                                                                                                                                                   |         |
| `Scrolled<webcontainer.scrolled>`                             |                                                                                                                                                                                                                   |         |
| `Shown<webcontainer.shown>`                                   |                                                                                                                                                                                                                   |         |

## Enumerations

<div id="webcontainer.displaysides">

<div class="rst-class">

forsearch

</div>

</div>

WebContainer.DisplaySides

### DisplaySides

> Specifies where the popover will display relative to the control its popping over.
>
> | Enum   | Description                         |
> |--------|-------------------------------------|
> | Bottom | Below the parent control.           |
> | Left   | To the left of the parent control.  |
> | Top    | Above the parent control.           |
> | Right  | To the right of the parent control. |

<div id="webcontainer.scrolldirections">

<div class="rst-class">

forsearch

</div>

</div>

WebContainer.ScrollDirections

### ScrollDirections

> The various directions that can be assigned for scrolling.
>
> | Enum       | Description                                                                                       |
> |------------|---------------------------------------------------------------------------------------------------|
> | None       | The <span class="title-ref">WebContainer</span> cannot be scrolled.                               |
> | Horizontal | The <span class="title-ref">WebContainer</span> can only be scrolled horizontally.                |
> | Vertical   | The <span class="title-ref">WebContainer</span> can only be scrolled vertically.                  |
> | Both       | The <span class="title-ref">WebContainer</span> can be scrolled both horizontally and vertically. |

## Property descriptions

<div id="webcontainer.contextualmenu">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ContextualMenu

**ContextualMenu** As `WebMenuItem</api/user_interface/web/webmenuitem>`

> If you assign a `WebMenuItem</api/user_interface/web/webmenuitem>` to the control, it will be displayed when the user right-clicks the control.
>
> On a `WebPage</api/user_interface/web/webpage>`, you can disable/remove the default contextual menu by an empty `WebMenuItem</api/user_interface/web/webmenuitem>` class object to this property.
>
> This code populates a contextual menu in the Shown event of the control.
>
> ``` xojo
> Var menu As New WebMenuItem
>
> menu.AddMenuItem("One")
> menu.AddMenuItem("Two")
> menu.AddMenuItem("Three")
> Me.ContextualMenu = menu
> ```
>
> The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:
>
> ``` xojo
> Select Case hitItem.Text
> Case "One"
>   MessageBox("One")
> Case "Two"
>   MessageBox("Two")
> Case "Three"
>   MessageBox("Three")
> End Select
> ```

<div id="webcontainer.controlcount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ControlCount

**ControlCount** As `Integer</api/data_types/integer>`

> The number of controls on the <span class="title-ref">WebContainer</span>.
>
> This property is read-only.

<div id="webcontainer.controlid">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ControlID

**ControlID** As `String</api/data_types/string>`

> Identifies the control on a per session basis.
>
> This property is read-only.

<div id="webcontainer.enabled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Enabled

**Enabled** As `Boolean</api/data_types/boolean>`

> When `True</api/language/true>` the **WebControl** is drawn enabled and responds to user action. When `False</api/language/false>`, the control appears as disabled and does not respond to user actions.
>
> In the case of `WebTimer</api/web/webtimer>`, when set to `False</api/language/false>` this disables and stops the WebTimer. When set to `True</api/language/true>`, it starts the WebTimer.
>
> Disable a button when a check box value changes:
>
> ``` xojo
> If AllowSaveCheckBox.Value Then
>   SaveButton.Enabled = True
> Else
>   AllowSaveButton.Enabled = False
> End If
> ```

<div id="webcontainer.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Height

**Height** As `Integer</api/data_types/integer>`

> The height (in pixels) of the control.

<div id="webcontainer.indicator">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Indicator

**Indicator** As `Indicators<webuicontrol.indicators>`

> The color scheme for the control.

<div id="webcontainer.layoutdirection">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LayoutDirection

**LayoutDirection** As `WebView.LayoutDirections<webview.layoutdirections>`

> The direction in which <span class="title-ref">WebContainer</span> will flow when added at runtime to a layout whose `LayoutType<webview.layouttype>` is set to Flex.

<div id="webcontainer.layouttype">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LayoutType

**LayoutType** As `WebView.LayoutTypes<webview.layouttypes>`

> The type of layout dictates whether controls are positioned at fixed locations or can move to accommodate changes to the bounds of the WebView, in the latter case, only for <span class="title-ref">WebContainer</span> that are added at runtime to a layout whose type is set to Flex.

<div id="webcontainer.left">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Left

**Left** As `Integer</api/data_types/integer>`

> The position of the left side of the **WebUIControl** in pixels, relative to the web page.

<div id="webcontainer.lockbottom">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LockBottom

**LockBottom** As `Boolean</api/data_types/boolean>`

> Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning web page.

<div id="webcontainer.lockhorizontal">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LockHorizontal

**LockHorizontal** As `Boolean</api/data_types/boolean>`

> LockHorizontal overrides LockLeft and LockRight. It allows you to proportionally lock a control's position to the center of its parent control (or web page).
>
> For example, if you place a control in the center of the page and sets both LockHorizontal and LockVertical, the control will stay in the center of the page.

<div id="webcontainer.lockleft">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LockLeft

**LockLeft** As `Boolean</api/data_types/boolean>`

> Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning web page.

<div id="webcontainer.lockright">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LockRight

**LockRight** As `Boolean</api/data_types/boolean>`

> Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning web page.

<div id="webcontainer.locktop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LockTop

**LockTop** As `Boolean</api/data_types/boolean>`

> Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning web page.

<div id="webcontainer.lockvertical">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LockVertical

**LockVertical** As `Boolean</api/data_types/boolean>`

> LockVertical overrides LockTop and LockBottom. It allows you to proportionally lock a control's position to keep it centered within the parent control or web page.
>
> For example, if you place a control in the center of the page, and sets both LockHorizontal and LockVertical, the control will stay in the center of the page.

<div id="webcontainer.name">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Name

**Name** As `String</api/data_types/string>`

> The name of the control.
>
> This property is read-only.

<div id="webcontainer.page">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Page

**Page** As `WebPage</api/user_interface/web/webpage>`

> Identifies the web page that contains the control.
>
> This property is read-only.

<div id="webcontainer.panelindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.PanelIndex

**PanelIndex** As `Integer</api/data_types/integer>`

> If the control has been placed on a <span class="title-ref">WebTabPanel</span> or `WebPagePanel</api/user_interface/web/webpagepanel>` control, this is the panel (page/tab) that the control is on. If the control is not on a panel, it returns -1.
>
> The first panel is numbered zero. If the control has been placed on a panel of a <span class="title-ref">WebTabPanel</span> or `WebPagePanel</api/user_interface/web/webpagepanel>` control, it returns the panel number. If the control is not on a `WebPagePanel</api/user_interface/web/webpagepanel>` or <span class="title-ref">WebTabPanel</span>, it returns -1. If you change the PanelIndex to a nonexistent panel, the control will disappear until you give it a PanelIndex value that corresponds to a panel that exists.
>
> If you are looking to change the currently selected panel (page/tab), use `SelectedPanelIndex<webpagecontrol.selectedpanelindex>`.
>
> This code displays the panel index of the control that is on the page.
>
> ``` xojo
> MessageBox(Me.SelectedPanelIndex.ToString)
> ```

<div id="webcontainer.parent">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Parent

**Parent** As `WebView</api/user_interface/web/webview>`

> Used to get the control's parent control or page. If the parent control is a <span class="title-ref">WebContainer</span>, then it returns the <span class="title-ref">WebContainer</span>. If it is on a `WebPage</api/user_interface/web/webpage>`, it returns the `WebPage</api/user_interface/web/webpage>`.
>
> This property is read-only.

<div id="webcontainer.scrolldirection">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ScrollDirection

**ScrollDirection** As `ScrollDirections<webcontainer.scrolldirections>`

> The direction or directions in which the user can scroll the <span class="title-ref">WebContainer</span> assuming that the bounds of the instance are smaller than bounds of the <span class="title-ref">WebContainer</span> itself.
>
> This property is read-only.

<div id="webcontainer.scrollposition">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ScrollPosition

**ScrollPosition** As `Point</api/graphics/point>`

> Returns the current scroll position of the <span class="title-ref">WebContainer</span> as a `Point</api/graphics/point>` object, representing the coordinates (X, Y) of the top-left corner of the visible content area. The X value indicates horizontal scrolling, and the Y value indicates vertical scrolling. This property is only meaningful when scrolling is enabled and available within the <span class="title-ref">WebContainer</span> (e.g., when content exceeds the container's visible bounds). If scrolling is not possible, the returned value reflects the default position (typically (0, 0)).

<div id="webcontainer.tabindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.TabIndex

**TabIndex** As `Integer</api/data_types/integer>`

> The **WebContainer's** control's position in the Tab Order. The control with a TabIndex of 0 is the first **WebUIControl** to get the focus when the page opens in the browser.
>
> This example sets the control's TabIndex.
>
> ``` xojo
> Me.TabIndex = 2
> ```

<div id="webcontainer.tooltip">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Tooltip

**Tooltip** As `WebToolTip</api/user_interface/web/webtooltip>`

> Text of a message displayed as a tooltip.
>
> The tip is displayed when the user places the mouse on the control and leaves it there.
>
> This code in the Shown event of a Button sets the tooltip:
>
> ``` xojo
> Me.Tooltip = "Save changes"
> ```

<div id="webcontainer.top">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Top

**Top** As `Integer</api/data_types/integer>`

> The top of the control in local coordinates relative to the web page.

<div id="webcontainer.visible">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Visible

**Visible** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the control is drawn. If `False</api/language/false>`, it's not.
>
> Hide a control based on a checkbox setting:
>
> ``` xojo
> If ShowEmailCheckbox.Value Then
>   EmailField.Visible = True
> Else
>   EmailField.Visible = False
> End If
> ```

<div id="webcontainer.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Width

**Width** As `Integer</api/data_types/integer>`

> The width (in pixels) of the web control.
>
> This code in the Shown event handler increases the size of the control:
>
> ``` xojo
> Me.Width = Me.Width + 50
> ```

## Method descriptions

<div id="webcontainer.acceptpicturedrop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AcceptPictureDrop

**AcceptPictureDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a picture drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webcontainer.acceptrawdatadrop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AcceptRawDataDrop

**AcceptRawDataDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a raw data drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webcontainer.accepttextdrop">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AcceptTextDrop

**AcceptTextDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a picture drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webcontainer.addcontrol">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AddControl

**AddControl**(Child As `WebControl</api/user_interface/web/webcontrol>`)

> Adds the passed `Control</api/user_interface/web/webuicontrol>` to the `WebView</api/user_interface/web/webview>`.
>
> This code adds a `WebTextField</api/user_interface/web/webtextfield>` to the page:
>
> ``` xojo
> Var tf As New WebTextField
> tf.Left = 100
> tf.Top = 50
> tf.Enabled = True
> Self.AddControl(tf)
> ```

<div id="webcontainer.allowpicturedrag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AllowPictureDrag

**AllowPictureDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as a picture.

<div id="webcontainer.allowrawdatadrag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AllowRawDataDrag

**AllowRawDataDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as raw data.

<div id="webcontainer.allowtextdrag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.AllowTextDrag

**AllowTextDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as text.

<div id="webcontainer.close">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Close

**Close**

> This removes the control from the page, but only if the control is part of a Control Set or is a <span class="title-ref">WebContainer</span>. Otherwise it does not do anything.
>
> In general, if you want to add or remove controls from pages, use a <span class="title-ref">WebContainer</span>.

<div id="webcontainer.controlat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ControlAt

**ControlAt**(index As `Integer</api/data_types/integer>`) As `WebControl</api/user_interface/web/webcontrol>`

> Returns the `WebControl</api/user_interface/web/webcontrol>` at the *index* passed.

<div id="webcontainer.controls">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Controls

**Controls** As `Iterable</api/language/iterable>`

> Allows you to iterate through the controls on the layout.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This does not include non-control object instances. For that, use the `Objects<webcontainer.objects>` method.
>
> </div>

<div id="webcontainer.embedwithin">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.EmbedWithin

**EmbedWithin**(webView As `WebView</api/user_interface/web/webview>`, Width As `Integer</api/data_types/integer>`, Height As `Integer</api/data_types/integer>`)

> Embeds the WebView in the current page without drawing the window frame, title bar, title bar widgets, grow handle, and so forth. Use this set of parameters with webpages whose `LayoutType<webpage.layouttype>` is Flex.

**EmbedWithin**(webView As `WebView</api/user_interface/web/webview>`, X As `Integer</api/data_types/integer>`, Y As `Integer</api/data_types/integer>`, Width As `Integer</api/data_types/integer>`, Height As `Integer</api/data_types/integer>`)

> Embeds the WebView in the current page without drawing the window frame, title bar, title bar widgets, grow handle, and so forth. Use this set of parameters with webpages whose `LayoutType<webpage.layouttype>` is Fixed.
>
> The *X* and *Y* parameters determine the location of the top-left corner, relative to the containing page. The parameters *Width* and *Height* determine the size of the embedded view.
>
> You can use EmbedWithin in to dynamically add controls to a page. Add the control (or controls) you want to add to a <span class="title-ref">WebContainer</span> and then use EmbedWithin to add the container to the page at runtime.
>
> The locking properties of the <span class="title-ref">WebContainer</span> are not carried over when you use EmbedWithin. Instead, set these values accordingly before calling EmbedWithin. For example:
>
> ``` xojo
> Var c As New MyContainer
> c.LockLeft = True
> c.LockTop = True
> c.LockRight = True
> c.EmbedWithin(Self, 0, 0, c.Width, c.Height)
> ```
>
> This code adds a <span class="title-ref">WebContainer</span>, called *LoginContainer*, to a web page at runtime:
>
> ``` xojo
> Var login As New LoginContainer
> login.LockLeft = True
> login.LockTop = True
> login.EmbedWithin(Self, 0, 0, login.Width, login.Height)
> ```

<div id="webcontainer.executejavascript">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ExecuteJavaScript

**ExecuteJavaScript**(script As `String</api/data_types/string>`)

> Executes the JavaScript passed. The JavaScript passed can call a JavaScript function in a WebPageSource control.
>
> The Xojo web framework uses EcmaScript 6 which is more strict than previous versions of JavaScript. For more details, see the [EcmaScript 6 documentation](https://www.ecma-international.org/ecma-262/6.0/).
>
> This code in the Pressed event of a Button displays an alert using JavaScript:
>
> ``` xojo
> Me.ExecuteJavaScript("alert('Hello!');")
> ```
>
> This code will select the text in a WebTextField (or WebTextArea):
>
> ``` xojo
> WebTextField1.ExecuteJavascript("document.getElementById('" + _
>   WebTextField1.ControlID + "_inner').select();")
> ```

<div id="webcontainer.gotourl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.GotoURL

**GotoURL**(url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Opens the passed *url* in place of the current web page or downloads a file. If *inNewWindow* is `True</api/language/true>`, the browser is asked to open the *url* in a new window.
>
> If the browser has popup windows disabled and *inNewWindow* is `True</api/language/true>`, the method silently fails and the page is not shown.
>
> If *inNewWindow* is `False</api/language/false>`, the running web app is replaced with the specified *url*. If you want to display an external web site within your web app, use the `WebHTMLViewer</api/user_interface/web/webhtmlviewer>` control.
>
> Display a web site in a new popup window:
>
> ``` xojo
> Me.GotoURL("http://www.wikipedia.org", True)
> ```

<div id="webcontainer.lastcontrolindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.LastControlIndex

**LastControlIndex** As `Integer</api/data_types/integer>`

> The index of the last `WebControl</api/user_interface/web/webcontrol>` on the `WebView</api/user_interface/web/webview>`.

<div id="webcontainer.objects">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Objects

**Objects** As `Iterable</api/language/iterable>`

> Allows you to iterate through all the non-control object instances on the container.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This does not include controls. For that, use the `Controls<webcontainer.controls>` method.
>
> </div>

<div id="webcontainer.removecontrol">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.RemoveControl

**RemoveControl**(control As `WebUIControl</api/user_interface/web/webuicontrol>`)

> Removes the *control* from the <span class="title-ref">WebContainer</span>.

<div id="webcontainer.setfocus">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.SetFocus

**SetFocus**

> Sets the focus to the `Control</api/user_interface/web/webuicontrol>`.
>
> This code checks for a required value when a button is pressed:
>
> ``` xojo
> If UserNameField.Text.IsEmpty Then
>   MessageBox("Please enter your UserName.")
>   UserNameField.SetFocus
>   Return
> End If
> ```

<div id="webcontainer.showpopover">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ShowPopover

**ShowPopover**(parentControl As `WebUIControl</api/user_interface/web/webuicontrol>`, displaySide As `WebContainer.DisplaySides<webcontainer.displaysides>` = `WebContainer.DisplaySides<webcontainer.displaysides>`.Bottom, x As `Integer</api/data_types/integer>` = -1, y As `Integer</api/data_types/integer>` = -1)

> Displays the container as a popover next to the *parentControl* based upon the parameters passed. When provided, the optional *x* and *y* values passed display the popover at that offset relative to the upper-left corner of the parent control.
>
> This example from a `button's Pressed</api/user_interface/web/webbutton>` event displays the container named *MyPopover* below (the default) the button:
>
> ``` xojo
> Var c As New MyPopover
> c.ShowPopover(Me)
> ```

<div id="webcontainer.style">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Style

**Style** As `WebStyle</api/user_interface/web/webstyle>`

**Style**(`Assigns</api/language/assigns>` value As `WebStyle</api/user_interface/web/webstyle>`)

> The `WebStyle</api/user_interface/web/webstyle>` for the control.
>
> In the `Pressed<webbutton.pressed>` event of a `WebButton</api/user_interface/web/webbutton>`, set the text to bold:
>
> ``` xojo
> Var style As New WebStyle
> style.Bold = True
> Me.Style = style
> ```

<div id="webcontainer.updatebrowser">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.UpdateBrowser

**UpdateBrowser**

> Forces the current values of the control to be sent to the browser.
>
> This method is useful when you are computing values in a loop and wish to update the browser immediately rather than wait until the current method ends.
>
> This code iterates through a `RowSet</api/databases/rowset>` of `database rows</api/databases/databaserow>`, updates a `ProgressBar</api/user_interface/web/webprogressbar>` and then forces the updated `ProgressBar</api/user_interface/web/webprogressbar>` to be sent to the browser via UpdateBrowser.
>
> ``` xojo
> ProgressBar1.MaximumValue = SalesData.RowCount
> For Each row As DatabaseRow in SalesData
>   AnalyzeSales(row)
>   ProgressBar1.Value = ProgressBar1.Value + 1
>   ProgressBar1.UpdateBrowser
> Next
> ```

## Event descriptions

<div id="webcontainer.closed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Closed

**Closed**

> The control has been removed from the browser either because the page has closed or the control's Close method was called.

<div id="webcontainer.contextualmenuselected">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.ContextualMenuSelected

**ContextualMenuSelected**(hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`)

> Called when a contextual menu item is selected. This selected item is contained in *hitItem*.
>
> This code populates a contextual menu in the Opening event of a `WebToolbar</api/user_interface/web/webtoolbar>`:
>
> ``` xojo
> Var menu As New WebMenuItem
>
> menu.AddMenuItem("One")
> menu.AddMenuItem("Two")
> menu.AddMenuItem("Three")
> Me.ContextualMenu = menu
> ```
>
> The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:
>
> ``` xojo
> Select Case hitItem.Text
> Case "One"
>   MessageBox("One")
> Case "Two"
>   MessageBox("Two")
> Case "Three"
>   MessageBox("Three")
> End Select
> ```

<div id="webcontainer.dropobject">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.DropObject

**DropObject**(obj As `WebDragItem</api/user_interface/web/webdragitem>`, action As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`)

> Called when a dragged item is over a control that can accept it. The dragged item is contained in *obj* and the type of drag is identified by *action*.

<div id="webcontainer.hidden">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Hidden

**Hidden**

> The control is about to become no longer visible. This could be because the page is being closed, is being replaced as the foreground page by another page or because the control or a parent control's Visible property has been set to `False</api/language/false>`.
>
> The event is similar to the `Window.Deactivate<window.deactivate>` event in a desktop app.

<div id="webcontainer.opening">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Opening

**Opening**

> The control has been created and the page is opening but has not been sent to the browser yet.
>
> The Opening event handler can be used to initialize non-visual properties and settings for controls.
>
> In most cases, you should use the `Shown<webuicontrol.shown>` event to initialize controls.

<div id="webcontainer.overflowed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Overflowed

**Overflowed**(width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`)

> The area (in pixels) by which <span class="title-ref">WebContainer</span> have overflowed the bounds of a WebView whose `LayoutType<webview.layouttype>` is set to `WebView.LayoutTypes<webview.layouttypes>`.

<div id="webcontainer.pressed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Pressed

**Pressed**(x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`)

> The user pressed on the container at the coordinates passed.

<div id="webcontainer.resized">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Resized

**Resized**

> The `WebView</api/user_interface/web/webview>` has been resized either because the user resized the browser window or the `WebView</api/user_interface/web/webview>` was resized at runtime via code.

<div id="webcontainer.scrolled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Scrolled

**Scrolled**

> The <span class="title-ref">WebContainer</span> has been scrolled.

<div id="webcontainer.shown">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebContainer.Shown

**Shown**

> The control has appeared on the currently displayed page. This could be because its parent page just finished loading, its parent page has come to the foreground or the control is now visible having been previously invisible because it or its parent control's Visible property has been set to `True</api/language/true>`.
>
> Use the Shown event for initializing your controls or doing anything that would interact with other controls or user interface elements on the web page instead of the `Opening<webcontrol.opening>` event.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This event is the web equivalent to the `DesktopWindow.Activated<desktopwindow.activated>` event.
>
> </div>
>
> This code in the Shown event of a `WebListBox</api/user_interface/web/weblistbox>` adds 2 rows with 3 columns:
>
> ``` xojo
> Me.RemoveAllRows
> Me.AddRow("Row 1", "Bob", "Roberts")
> Me.AddRow("Row 2", "Barb", "Reynolds")
> ```
>
> This example sets the text of a label:
>
> ``` xojo
> If Session.LoggedIn Then
>   Me.Text = "Welcome!"
> Else
>   Me.Text = "Welcome, " + Session.UserName
> End If
> ```

## 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 <span class="title-ref">WebContainer</span> and then after placing it on a webpage or other <span class="title-ref">WebContainer</span>, make the <span class="title-ref">WebContainer</span> on the page smaller than it would normally appear. The `ScrollDirection<webcontainer.scrolldirection>` property controls which directions the user can scroll the <span class="title-ref">WebContainer</span> if any.

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

WebContainers can only contain controls that are subclasses of `WebUIControl</api/user_interface/web/webuicontrol>`.

## Sample code

This code adds a <span class="title-ref">WebContainer</span>, called *LoginContainer*, to a web page at runtime:

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

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | Web |
| **Operating Systems** | All |

<div class="seealso">

`WebView</api/user_interface/web/webview>` parent class; `WebUIControl</api/user_interface/web/webuicontrol>`, `WebPage</api/user_interface/web/webpage>` classes.

</div>
