Class

# WebDialog

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

## Description

A <span class="title-ref">WebDialog</span> is a small dialog window that displays as a sheet, palette or modal dialog within a web page.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                         | Type                                               | Read-Only | Shared |
|----------------------------------------------|----------------------------------------------------|-----------|--------|
| `ContextualMenu<webdialog.contextualmenu>`   | `WebMenuItem</api/user_interface/web/webmenuitem>` |           |        |
| `ControlCount<webdialog.controlcount>`       | `Integer</api/data_types/integer>`                 | ✓         |        |
| `ControlID<webdialog.controlid>`             | `String</api/data_types/string>`                   | ✓         |        |
| `Enabled<webdialog.enabled>`                 | `Boolean</api/data_types/boolean>`                 |           |        |
| `Height<webdialog.height>`                   | `Integer</api/data_types/integer>`                 |           |        |
| `Indicator<webdialog.indicator>`             | `Indicators<webuicontrol.indicators>`              |           |        |
| `LayoutDirection<webdialog.layoutdirection>` | `LayoutDirections<webview.layoutdirections>`       |           |        |
| `LayoutType<webdialog.layouttype>`           | `WebView.LayoutTypes<webview.layouttypes>`         |           |        |
| `Left<webdialog.left>`                       | `Integer</api/data_types/integer>`                 | ✓         |        |
| `LockBottom<webdialog.lockbottom>`           | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockHorizontal<webdialog.lockhorizontal>`   | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockLeft<webdialog.lockleft>`               | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockRight<webdialog.lockright>`             | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockVertical<webdialog.lockvertical>`       | `Boolean</api/data_types/boolean>`                 |           |        |
| `Name<webdialog.name>`                       | `String</api/data_types/string>`                   | ✓         |        |
| `Page<webdialog.page>`                       | `WebPage</api/user_interface/web/webpage>`         | ✓         |        |
| `Parent<webdialog.parent>`                   | `WebView</api/user_interface/web/webview>`         | ✓         |        |
| `Position<webdialog.position>`               | `Positions<webdialog.positions>`                   |           |        |
| `TabIndex<webdialog.tabindex>`               | `Integer</api/data_types/integer>`                 |           |        |
| `Title<webdialog.title>`                     | `String</api/data_types/string>`                   |           |        |
| `Tooltip<webdialog.tooltip>`                 | `WebToolTip</api/user_interface/web/webtooltip>`   |           |        |
| `Top<webdialog.top>`                         | `Integer</api/data_types/integer>`                 | ✓         |        |
| `Visible<webdialog.visible>`                 | `Boolean</api/data_types/boolean>`                 |           |        |
| `Width<webdialog.width>`                     | `Integer</api/data_types/integer>`                 |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                             | Parameters                                                                                                                                    | Returns                                          | Shared |
|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|--------|
| `AcceptPictureDrop<webdialog.acceptpicturedrop>` | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                                  |        |
| `AcceptRawDataDrop<webdialog.acceptrawdatadrop>` | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                                  |        |
| `AcceptTextDrop<webdialog.accepttextdrop>`       | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                                  |        |
| `AddControl<webdialog.addcontrol>`               | Child As `WebControl</api/user_interface/web/webcontrol>`                                                                                     |                                                  |        |
| `AllowPictureDrag<webdialog.allowpicturedrag>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                                  |        |
| `AllowRawDataDrag<webdialog.allowrawdatadrag>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                                  |        |
| `AllowTextDrag<webdialog.allowtextdrag>`         | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                                  |        |
| `Close<webdialog.close>`                         |                                                                                                                                               |                                                  |        |
| `ControlAt<webdialog.controlat>`                 | index As `Integer</api/data_types/integer>`                                                                                                   | `WebControl</api/user_interface/web/webcontrol>` |        |
| `Controls<webdialog.controls>`                   |                                                                                                                                               | `Iterable</api/language/iterable>`               |        |
| `ExecuteJavaScript<webdialog.executejavascript>` | script As `String</api/data_types/string>`                                                                                                    |                                                  |        |
| `GotoURL<webdialog.gotourl>`                     | url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                     |                                                  |        |
| `Hide<webdialog.hide>`                           |                                                                                                                                               |                                                  |        |
| `LastControlIndex<webdialog.lastcontrolindex>`   |                                                                                                                                               | `Integer</api/data_types/integer>`               |        |
| `Objects<webdialog.objects>`                     |                                                                                                                                               | `Iterable</api/language/iterable>`               |        |
| `RemoveControl<webdialog.removecontrol>`         | control As `WebUIControl</api/user_interface/web/webuicontrol>`                                                                               |                                                  |        |
| `SetFocus<webdialog.setfocus>`                   |                                                                                                                                               |                                                  |        |
| `Show<webdialog.show>`                           |                                                                                                                                               |                                                  |        |
| `Style<webdialog.style>`                         |                                                                                                                                               | `WebStyle</api/user_interface/web/webstyle>`     |        |
|                                                  | `Assigns</api/language/assigns>` value As `WebStyle</api/user_interface/web/webstyle>`                                                        |                                                  |        |
| `UpdateBrowser<webdialog.updatebrowser>`         |                                                                                                                                               |                                                  |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                       | Parameters                                                                                                                                                                                                        | Returns |
|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `ContextualMenuSelected<webdialog.contextualmenuselected>` | hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`                                                                                                                                                     |         |
| `Dismissed<webdialog.dismissed>`                           |                                                                                                                                                                                                                   |         |
| `DropObject<webdialog.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<webdialog.hidden>`                                 |                                                                                                                                                                                                                   |         |
| `Opening<webdialog.opening>`                               |                                                                                                                                                                                                                   |         |
| `Overflowed<webdialog.overflowed>`                         | width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`                                                                                                                         |         |
| `Resized<webdialog.resized>`                               |                                                                                                                                                                                                                   |         |
| `Shown<webdialog.shown>`                                   |                                                                                                                                                                                                                   |         |

## Enumerations

<div id="webdialog.positions">

<div class="rst-class">

forsearch

</div>

</div>

WebDialog.Positions

### Positions

> Specifies where the dialog will appear vertically on the screen.
>
> | Enum   | Description                                         |
> |--------|-----------------------------------------------------|
> | Top    | The dialog will appear near the top of the screen.  |
> | Center | The dialog will appear in the center of the screen. |

## Property descriptions

<div id="webdialog.contextualmenu">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.ControlCount

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

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

<div id="webdialog.controlid">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.ControlID

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

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

<div id="webdialog.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Enabled

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

> When `True</api/language/true>` the **WebControl** is drawn enabled and responds to user action. When Fa:doc:\`False\</api/language/false\>\`lse, 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="webdialog.height">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Height

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

> The height (in pixels) of the control.

<div id="webdialog.indicator">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Indicator

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

> The color scheme for the control.

<div id="webdialog.layoutdirection">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.LayoutDirection

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

> The direction in which `WebContainer controls</api/user_interface/web/webcontainer>` will flow when added at runtime to a layout whose `LayoutType<webview.layouttype>` is set to Flex.

<div id="webdialog.layouttype">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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 `WebContainer controls</api/user_interface/web/webcontainer>` that are added at runtime to a layout whose type is set to Flex.

<div id="webdialog.left">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Left

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

> The position of the left side of the **WebUIControl** in pixels, relative to the web page.
>
> This property is read-only.

<div id="webdialog.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.lockhorizontal">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.lockvertical">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.name">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Name

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

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

<div id="webdialog.page">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Page

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

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

<div id="webdialog.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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 `WebContainer</api/user_interface/web/webcontainer>`, then it returns the `WebContainer</api/user_interface/web/webcontainer>`. 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="webdialog.position">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Position

**Position** As `WebDialog.Positions<webdialog.positions>`

> Determines where the dialog will appear vertically on the screen.

<div id="webdialog.tabindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.TabIndex

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

> The **WebUIControl'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="webdialog.title">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Title

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

> The title of the dialog box.This is only used for Palette dialogs.

<div id="webdialog.tooltip">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.top">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Top

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

> The top of the control in local coordinates relative to the web page.
>
> This property is read-only.

<div id="webdialog.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.width">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.acceptpicturedrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.acceptrawdatadrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.accepttextdrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.addcontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.allowpicturedrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.AllowPictureDrag

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

> Allows the control to be dragged as a picture.

<div id="webdialog.allowrawdatadrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.AllowRawDataDrag

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

> Allows the control to be dragged as raw data.

<div id="webdialog.allowtextdrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.AllowTextDrag

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

> Allows the control to be dragged as text.

<div id="webdialog.close">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Close

**Close**

> Removes the control from the page.

<div id="webdialog.controlat">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.controls">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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<webdialog.objects>` method.
>
> </div>

<div id="webdialog.executejavascript">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.gotourl">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.hide">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Hide

**Hide**

> Hides the dialog box. The dialog box is still in memory and accessible via code.
>
> You can use this on a button click event to hide the dialog. If you hide a dialog with the Hide method, you can display it again by calling Show.
>
> Hide the dialog:
>
> ``` xojo
> Self.Hide
> ```

<div id="webdialog.lastcontrolindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.objects">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Objects

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

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

<div id="webdialog.removecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.RemoveControl

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

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

<div id="webdialog.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.show">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Show

**Show**

> Shows the dialog if it was not yet open or is just hidden.
>
> Show a dialog:
>
> ``` xojo
> MyDialog.Show
> ```

<div id="webdialog.style">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.updatebrowser">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.contextualmenuselected">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.dismissed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Dismissed

**Dismissed**

> Called when the dialog is dismissed by calling its Hide or Close methods.
>
> Consider a dialog, MyDialog, which has a single button with this code in its Pressed event handler:
>
> ``` xojo
> Self.Close
> ```
>
> With this dialog dragged onto a web page, you can display it using this code (probably on the Pressed event handler of a button):
>
> ``` xojo
> MyDialog1.Show
> ```
>
> When the dialog is closed, the Dismissed event handler is called. This code displays a simple message to indicate it was closed:
>
> ``` xojo
> MessageBox("Dialog is closed.")
> ```
>
> In this event handler, you can also access properties of the dialog to check values that were entered or buttons that were pressed. For example, If there was a TextField on the dialog, you could get its value in the Dismissed event handler like this:
>
> ``` xojo
> Var text As String
> text = Me.TextField1.Text
> MessageBox("Text=" + text)
> ```
>
> Similarly, if your dialog has multiple buttons and you want to know which one was clicked, you will have to save that information into a property you can check. For example, you can add a *ButtonClicked As WebButton* property to the dialog. In an OK button (named *OKButton*), you then use this code to indicate that the OK button was pressed:
>
> ``` xojo
> ButtonClicked = Me
> Self.Close
> ```
>
> In a Cancel button (named *CancelButton*), you would use the same code:
>
> ``` xojo
> ButtonClicked = Me
> Self.Close
> ```
>
> Now when the dialog is closed, you can check the ButtonClicked property in the Dismissed event handler to see which button was used to close the dialog:
>
> ``` xojo
> Select Case Me.ButtonClicked
> Case Me.OKButton
>   MessageBox("OK selected.")
> Case Me.CancelButton
>   MessageBox("Cancel selected.")
> End Select
> ```

<div id="webdialog.dropobject">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.hidden">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Hidden

**Hidden**

> The dialog is about to become no longer visible. This is usually because the Hide method has been called. However, it also could be because the page it is on is being closed, is being replaced as the foreground page by another page or because the dialog's Visible property has been set to `False</api/language/false>`.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This event is equivalent to the `DesktopWindow.Deactivated<desktopwindow.deactivated>` event in a desktop app.
>
> </div>

<div id="webdialog.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.overflowed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.Overflowed

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

> The area (in pixels) by which `WebContainers</api/user_interface/web/webcontainer>` have overflowed the bounds of a WebView whose `LayoutType<webview.layouttype>` is set to `Flex<webview.layouttypes>`.

<div id="webdialog.resized">

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

</div>

<div class="rst-class">

forsearch

</div>

WebDialog.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="webdialog.shown">

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

</div>

<div class="rst-class">

forsearch

</div>

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

WebDialogs can only contain controls that are subclasses of `WebControl</api/user_interface/web/webcontrol>`.

To display a dialog on your page, drag it to the Web Page Layout Editor or instantiate one in code. You can then display it by calling the Show method:

``` xojo
MyDialog.Show
```

In the dialog itself, you should have a way to close it, usually with a button with code like this:

``` xojo
Self.Close
```

When the dialog is closed, the Dismissed event handler (for the dialog on the web page) is called. There you can perform your actions.

Keep in mind that dialogs are not modal and do not stop your code from running. After calling MyDialog.Show, the next line of code will run. Use the Dismissed event handler to process the results from the dialog.

Dialogs can remain in view, even as a page is hidden from view. However, once a page is closed (rather than hidden) any dialogs attached to it are also removed.

For simple dialogs, you can instead use the `MessageBox</api/user_interface/messagebox>` method.

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

### Differences between dialogs in web and desktop applications

There are two important differences between dialogs in web applications versus desktop applications. The first is that web dialogs are a specific type project item whereas in a desktop application project they are a window with the Frame property set to a particular value. The other more important difference is that unlike in a desktop project, dialogs in a web application are asynchronous.

After creating a <span class="title-ref">WebDialog</span> by clicking Add Dialog in the Project Editor's command bar, you must add the dialog to any web page in front of which, you wish to show the dialog. All dialogs you add to your project will show up in the Controls pane of the `WebPage</api/user_interface/web/webpage>` Editor as they are treated, for the most part, like any other control on a webpage. To add the dialog to your page, drag it from the Controls pane to the `WebPage</api/user_interface/web/webpage>`. It will appear in the list of controller objects list at the bottom of the editor. You can then double-click the dialog to add code to its events.

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

### Dynamically displaying a dialog

At times, you may need to display a different dialog at runtime. For example, you may want to use a different dialog to display when the user is on a mobile device.

This example dynamically displays a dialog, MyDialog, which has a single button with this code in its Pressed event handler:

``` xojo
Self.Close
```

On a button on the web page, you can display the dialog like this:

``` xojo
Var d As New MyDialog
AddHandler d.Dismissed, AddressOf DismissedHandler
d.Show
```

DismissedHandler is a method on the web page declared like this:

``` xojo
Sub DismissedHandler(d As WebDialog)
  MessageBox("Dialog closed!")
End Sub
```

<div class="note">

<div class="title">

Note

</div>

Dynamically created Dialogs that are closed by calling Close cannot be shown again until you create a new instance.

</div>

## Sample code

Consider a dialog, MyDialog, which has a single button with this code in its Pressed event handler:

``` xojo
Self.Close
```

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

With this dialog dragged onto a web page, you can display it using this code (probably on the Pressed event handler of a button):

``` xojo
MyDialog1.Show
```

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

When the dialog is closed, the Dismissed event handler is called. This code displays a simple message to indicate it was closed:

``` xojo
MessageBox("Dialog is closed.")
```

## Compatibility

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

<div class="seealso">

`WebView</api/user_interface/web/webview>` parent class; `MessageBox</api/user_interface/messagebox>`, `WebPage</api/user_interface/web/webpage>`, `WebHTMLViewer</api/user_interface/web/webhtmlviewer>`, `DesktopWindow</api/user_interface/desktop/desktopwindow>` classes.

</div>
