Class

# WebSDKUIControl

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

## Description

<span class="title-ref">WebSDKUIControl</span> is a direct subclass of `WebUIControl</api/user_interface/web/webuicontrol>`, but because `WebUIControl</api/user_interface/web/webuicontrol>` inherits from `WebControl</api/user_interface/web/webcontrol>` it means that <span class="title-ref">WebSDKUIControl</span> doesn't actually have a direct relationship with WebSDKControl.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                             | Type                                               | Read-Only | Shared |
|--------------------------------------------------|----------------------------------------------------|-----------|--------|
| `ContextualMenu<websdkuicontrol.contextualmenu>` | `WebMenuItem</api/user_interface/web/webmenuitem>` |           |        |
| `ControlID<websdkuicontrol.controlid>`           | `String</api/data_types/string>`                   | ✓         |        |
| `Enabled<websdkuicontrol.enabled>`               | `Boolean</api/data_types/boolean>`                 |           |        |
| `Height<websdkuicontrol.height>`                 | `Integer</api/data_types/integer>`                 |           |        |
| `Indicator<websdkuicontrol.indicator>`           | `Indicators<webuicontrol.indicators>`              |           |        |
| `Left<websdkuicontrol.left>`                     | `Integer</api/data_types/integer>`                 |           |        |
| `LockBottom<websdkuicontrol.lockbottom>`         | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockHorizontal<websdkuicontrol.lockhorizontal>` | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockLeft<websdkuicontrol.lockleft>`             | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockRight<websdkuicontrol.lockright>`           | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockTop<websdkuicontrol.locktop>`               | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockVertical<websdkuicontrol.lockvertical>`     | `Boolean</api/data_types/boolean>`                 |           |        |
| `Name<websdkuicontrol.name>`                     | `String</api/data_types/string>`                   | ✓         |        |
| `Page<websdkuicontrol.page>`                     | `WebPage</api/user_interface/web/webpage>`         | ✓         |        |
| `PanelIndex<websdkuicontrol.panelindex>`         | `Integer</api/data_types/integer>`                 |           |        |
| `Parent<websdkuicontrol.parent>`                 | `WebView</api/user_interface/web/webview>`         | ✓         |        |
| `TabIndex<websdkuicontrol.tabindex>`             | `Integer</api/data_types/integer>`                 |           |        |
| `Tooltip<websdkuicontrol.tooltip>`               | `WebToolTip</api/user_interface/web/webtooltip>`   |           |        |
| `Top<websdkuicontrol.top>`                       | `Integer</api/data_types/integer>`                 |           |        |
| `Visible<websdkuicontrol.visible>`               | `Boolean</api/data_types/boolean>`                 |           |        |
| `Width<websdkuicontrol.width>`                   | `Integer</api/data_types/integer>`                 |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                         | Parameters                                                                                                                                    | Returns                                      | Shared |
|--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|--------|
| `AcceptPictureDrop<websdkuicontrol.acceptpicturedrop>`       | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AcceptRawDataDrop<websdkuicontrol.acceptrawdatadrop>`       | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AcceptTextDrop<websdkuicontrol.accepttextdrop>`             | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AllowPictureDrag<websdkuicontrol.allowpicturedrag>`         | allowedDragActionTypes As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`                                                          |                                              |        |
| `AllowRawDataDrag<websdkuicontrol.allowrawdatadrag>`         | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `AllowTextDrag<websdkuicontrol.allowtextdrag>`               | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                              |        |
| `Close<websdkuicontrol.close>`                               |                                                                                                                                               |                                              |        |
| `CSSClasses<websdkuicontrol.cssclasses>`                     |                                                                                                                                               | `WebCSSClasses</api/web/webcssclasses>`      |        |
| `ExecuteJavaScript<websdkuicontrol.executejavascript>`       | script As `String</api/data_types/string>`                                                                                                    |                                              |        |
| `FrameworkLibraryURL<websdkuicontrol.frameworklibraryurl>`   | libraryFileName As `String</api/data_types/string>`                                                                                           |                                              |        |
| `GoToURL<websdkuicontrol.gotourl>`                           | url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                     |                                              |        |
| `LazyLoadDependencies<websdkuicontrol.lazyloaddependencies>` |                                                                                                                                               | `Boolean</api/data_types/boolean>`           |        |
| `SetFocus<websdkuicontrol.setfocus>`                         |                                                                                                                                               |                                              |        |
| `Style<websdkuicontrol.style>`                               |                                                                                                                                               | `WebStyle</api/user_interface/web/webstyle>` |        |
|                                                              | `Assigns</api/language/assigns>` value As `WebStyle</api/user_interface/web/webstyle>`                                                        |                                              |        |
| `UpdateBrowser<websdkuicontrol.updatebrowser>`               |                                                                                                                                               |                                              |        |
| `UpdateControl<websdkuicontrol.updatecontrol>`               | sendImmediately As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                                                          |                                              |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                                   | Parameters                                                                                                                                                                                                        | Returns                            |
|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| `Closed<websdkuicontrol.closed>`                                       |                                                                                                                                                                                                                   |                                    |
| `ContextualMenuSelected<websdkuicontrol.contextualmenuselected>`       | hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`                                                                                                                                                     |                                    |
| `DrawControlInLayoutEditor<websdkuicontrol.drawcontrolinlayouteditor>` | g As `Graphics</api/graphics/graphics>`                                                                                                                                                                           |                                    |
| `DropObject<websdkuicontrol.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>` |                                    |
| `ExecuteEvent<websdkuicontrol.executeevent>`                           | name As `String</api/data_types/string>`, parameters As `JSONItem</api/text/json/jsonitem>`                                                                                                                       | `Boolean</api/data_types/boolean>` |
| `HandleRequest<websdkuicontrol.handlerequest>`                         | request As `WebRequest</api/web/webrequest>`, response As `WebResponse</api/web/webresponse>`                                                                                                                     | `Boolean</api/data_types/boolean>` |
| `Hidden<websdkuicontrol.hidden>`                                       |                                                                                                                                                                                                                   |                                    |
| `JavaScriptClassName<websdkuicontrol.javascriptclassname>`             |                                                                                                                                                                                                                   | `String</api/data_types/string>`   |
| `Opening<websdkuicontrol.opening>`                                     |                                                                                                                                                                                                                   |                                    |
| `Serialize<websdkuicontrol.serialize>`                                 | js As `JSONItem</api/text/json/jsonitem>`                                                                                                                                                                         |                                    |
| `SessionCSSURLs<websdkuicontrol.sessioncssurls>`                       | session As `WebSession</api/web/websession>`                                                                                                                                                                      | `String()</api/data_types/string>` |
| `SessionHead<websdkuicontrol.sessionhead>`                             | session As `WebSession</api/web/websession>`                                                                                                                                                                      | `String</api/data_types/string>`   |
| `SessionJavascriptURLs<websdkuicontrol.sessionjavascripturls>`         | session As `WebSession</api/web/websession>`                                                                                                                                                                      | `String()</api/data_types/string>` |
| `Shown<websdkuicontrol.shown>`                                         |                                                                                                                                                                                                                   |                                    |

## Constants

> These constants are designed to be used with the <span class="title-ref">WebSDKUIControl</span> to show icons at the Navigator and Library.
>
> For a *LibraryIcon* aim for 48x48, but note that these will scale depending on the Library settings. Currently we don't provide a way to specify all the acceptable sizes, i.e. 16x16, 32x32, 48x48. For a *NavigatorIcon* 16x16 is sufficient.
>
> | Name          | Description                                                                                                                                                             |
> |---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
> | NavigatorIcon | This constant is used to override the icon of your control in the Navigator. Using the WebSDKIconConverter, place the Base64 icon data into the value of this constant. |
> | LibraryIcon   | This constant is used to override the icon of your control in the Library. Using the WebSDKIconConverter, place the Base64 icon data into the value of this constant.   |

## Enumerations

<div id="websdkuicontrol.indicators">

<div class="rst-class">

forsearch

</div>

</div>

WebSDKUIControl.Indicators

### Indicators

> Specifies the color scheme for the control.
>
> | Name      |
> |-----------|
> | Default   |
> | Primary   |
> | Secondary |
> | Success   |
> | Danger    |
> | Warning   |
> | Info      |
> | Light     |
> | Dark      |
> | Link      |

## Property descriptions

<div id="websdkuicontrol.contextualmenu">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.controlid">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.ControlID

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

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

<div id="websdkuicontrol.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Enabled

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

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

<div id="websdkuicontrol.height">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Height

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

> The height (in pixels) of the control.

<div id="websdkuicontrol.indicator">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Indicator

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

> The color scheme for the control.
>
> This example sets the indicator of the button to Danger:
>
> ``` xojo
> Button1.Indicator = WebUIControl.Indicators.Danger
> ```

<div id="websdkuicontrol.left">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Left

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

> The position of the left side of the <span class="title-ref">WebUIControl</span> in pixels, relative to the web page.

<div id="websdkuicontrol.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.lockhorizontal">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.LockTop

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

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

<div id="websdkuicontrol.lockvertical">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.name">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Name

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

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

<div id="websdkuicontrol.page">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Page

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

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

<div id="websdkuicontrol.panelindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.PanelIndex

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

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

<div id="websdkuicontrol.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.tabindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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 <span class="title-ref">WebUIControl</span> to get the focus when the page opens in the browser.
>
> This example sets the control's TabIndex.
>
> ``` xojo
> Me.TabIndex = 2
> ```

<div id="websdkuicontrol.tooltip">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.top">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Top

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

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

<div id="websdkuicontrol.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.width">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.acceptpicturedrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.acceptrawdatadrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.accepttextdrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.allowpicturedrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.AllowPictureDrag

**AllowPictureDrag**(allowedDragActionTypes As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as a picture.

<div id="websdkuicontrol.allowrawdatadrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.AllowRawDataDrag

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

> Allows the control to be dragged as raw data.

<div id="websdkuicontrol.allowtextdrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.AllowTextDrag

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

> Allows the control to be dragged as text.

<div id="websdkuicontrol.close">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Close

**Close**

> Removes the control from the page.

<div id="websdkuicontrol.cssclasses">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.CSSClasses

**CSSClasses** As `WebCSSClasses</api/web/webcssclasses>`

> Returns the instance of `WebCSSClasses</api/web/webcssclasses>` for this control allowing you to add CSS classes to and remove CSS classes from the control.

<div id="websdkuicontrol.executejavascript">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.frameworklibraryurl">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.FrameworkLibraryURL

**FrameworkLibraryURL**(libraryFileName As `String</api/data_types/string>`)

> Returns the URL for a library filename available in the Xojo Web Framework. It's meant to be used in the `SessionJavascriptURLs<websdkcontrol.sessionjavascripturls>` and `SessionCSSURLs<websdkuicontrol.sessioncssurls>` events. For example, the following code will return the URLs for the Moment.js library:
>
> ``` xojo
> Var result() As String
>
> result.Add(FrameworkLibraryURL("moment-with-locales.min.js"))
> result.Add(FrameworkLibraryURL("moment-timezone-with-data.min.js"))
>
> Return result
> ```

<div id="websdkuicontrol.gotourl">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.lazyloaddependencies">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.LazyLoadDependencies

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

> This is a method that can be overridden by subclasses. By default it returns `False</api/language/false>`. Returning `True</api/language/true>` will lazy load CSS and JS dependencies for that control. If it's `False</api/language/false>` or the method hasn't been overridden, it won't do any lazy loading, everything will be downloaded when the framework creates the Session for that user.

<div id="websdkuicontrol.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.SetFocus

**SetFocus**

> If the control is enabled, this method sets the focus to the <span class="title-ref">WebUIControl</span>.
>
> 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="websdkuicontrol.style">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Style

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

> Returns the `WebStyle</api/user_interface/web/webstyle>` for the control.

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

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

> Assigns the *style* to 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="websdkuicontrol.updatebrowser">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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
> ```

<div id="websdkuicontrol.updatecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.UpdateControl

**UpdateControl**(sendImmediately As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Similar to the UpdateBrowser method, this method also sets the internal flag which indicates to the framework that your control needs a refresh on the browser. When *sendImmediately* is `False</api/language/false>`, any changes made are deferred until the event loop completes. When *sendImmediately* is `True</api/language/true>`, the changes will be sent at that very moment.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Calling this method with *sendImmediately* set to `True</api/language/true>` will override the "deferred" option of any changes before it was called.
>
> </div>

## Event descriptions

<div id="websdkuicontrol.closed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Closed

**Closed**

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

<div id="websdkuicontrol.contextualmenuselected">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.drawcontrolinlayouteditor">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.DrawControlInLayoutEditor

**DrawControlInLayoutEditor**(g As `Graphics</api/graphics/graphics>`)

> This event allows you to draw a preview of your control in the Layout Editor, similar to how the control will look like in at runtime. As this code will run as a script in the IDE, if it doesn't compile for any reason, you will see what happened in the Messages pane.
>
> This event fires whenever your control needs to be drawn in the Layout Editor.
>
> There is no need to re-open the project or restart the IDE, in order to see changes you make to the code in this event.
>
> For more information of how this works, see `Drawing Your Control<websdkuicontrol.drawing_your_control>`.

<div id="websdkuicontrol.dropobject">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.executeevent">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.ExecuteEvent

**ExecuteEvent**(name As `String</api/data_types/string>`, parameters As `JSONItem</api/text/json/jsonitem>`) As `Boolean</api/data_types/boolean>`

> This event fires when an event is sent from the browser to the app using the `triggerServerEvent` JavaScript method. Return `True</api/language/true>` if your control has handled the event.

<div id="websdkuicontrol.handlerequest">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.HandleRequest

**HandleRequest**(request As `WebRequest</api/web/webrequest>`, response As `WebResponse</api/web/webresponse>`) As `Boolean</api/data_types/boolean>`

> This event fires in the same way as `App.HandleURL<webapplication.handleURL>` does except that it is for requests that are only for the current control.
>
> To trigger this event you will need to create a specially formed URL:
>
> ``` xojo
> Var url As String = "https://www.yourdomain.com/sdk/" + Self.ControlID
> ```
>
> See the documentation for `WebApplication.HandleURL<webapplication.handleURL>` for usage.

<div id="websdkuicontrol.hidden">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Hidden

**Hidden**

> The control is about to become no longer visible. This could be because the page is being closed, is being replaced as the foreground page by another page or because the control or a parent control's Visible property has been set to `False</api/language/false>`.
>
> <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="websdkuicontrol.javascriptclassname">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.JavaScriptClassName

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

> This event fires when the control is first created to send the JavaScript constructor for your control to the browser.

<div id="websdkuicontrol.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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="websdkuicontrol.serialize">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.Serialize

**Serialize**(js As `JSONItem</api/text/json/jsonitem>`)

> This event fires when the framework sends the first configuration to your control in the browser, whenever a property on WebControl is changed and whenever you call the Xojo UpdateBrowser method.

<div id="websdkuicontrol.sessioncssurls">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.SessionCSSURLs

**SessionCSSURLs**(session As `WebSession</api/web/websession>`) As `String()</api/data_types/string>`

> This event fires each time a new session starts. You should return an array of URLs which point to any css stylesheets you need for your control to function. The Xojo framework will attempt to prevent duplicate URLs from being sent to the same session.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Hint: One reason we supply the session object is so you can figure out whether or not items have already been delivered to a particular session.
>
> </div>

<div id="websdkuicontrol.sessionhead">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.SessionHead

**SessionHead**(session As `WebSession</api/web/websession>`) As `String</api/data_types/string>`

> This event fires each time a new session starts. You should return a `String</api/data_types/string>` containing the items you wish to add to the `<head>` tag.

<div id="websdkuicontrol.sessionjavascripturls">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.SessionJavascriptURLs

**SessionJavascriptURLs**(session As `WebSession</api/web/websession>`) As `String()</api/data_types/string>`

> This event fires each time a new session starts. You should return an array of URLs which point to any javascript you need for your control to function, whether it be a subclass of XojoControl or an external library. The Xojo framework will attempt to prevent duplicate URLs from being sent to the same session.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> One reason we supply the session object is so you can figure out whether or not items have already been delivered to a particular session.
>
> </div>

<div id="websdkuicontrol.shown">

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

</div>

<div class="rst-class">

forsearch

</div>

WebSDKUIControl.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
> ```

## Drawing Your Control

As for Xojo 2020r1 <span class="title-ref">WebSDKUIControl</span> has the ability to draw itself in the Layout Editor using the same techniques that you use to draw a control in the Paint event of a Canvas control with one important difference: this event has access to the Properties and Constants of your class as well as the ability to query the current Bootstrap theme.

To draw a preview of your control in the Layout Editor, you must implement the DrawControlInLayoutEditor event. You may wish to implement it even if you're not using it to prevent this event from being available to the end users of your control. Most of the Xojo framework itself is not available in this event. If the code you have placed in the event can't compile or runs into a runtime issue, an amber warning icon will be drawn on your control and the errors will be displayed to the Messages pane.

<div class="important">

<div class="title">

Important

</div>

Methods cannot be called in this event.

</div>

Here's an example of how you would draw a red oval within the bounds of the control:

``` xojo
g.DrawingColor = Color.Red
g.DrawOval(0, 0, g.Width, g.Height)
```

In addition to the standard drawing controls, there are also some methods for accessing the properties and constants in your control as well as getting values from the user's current Bootstrap theme file.

### Property Methods

**BooleanProperty**(Name as String) as Boolean

> Gets the current value of a Boolean property of your control.

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

**ColorProperty**(name As `String</api/data_types/string>`) As `Color</api/data_types/color>`

> Gets the current value of a Color property of your control.

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

**DoubleProperty**(name As `String</api/data_types/string>`) As `Double</api/data_types/double>`

> Gets the current value of a Double property of your control.

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

**IntegerProperty**(name As `String</api/data_types/string>`) As `Integer</api/data_types/integer>`

> Gets the current value of an Integer property of your control.

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

**PictureProperty**(name As `String</api/data_types/string>`) As `Picture</api/graphics/picture>`

> Gets the current value of a Picture property of your control.

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

**StringProperty**(name As `String</api/data_types/string>`) As `String</api/data_types/string>`

> Gets the current value of a String property of your control.

### Constant Methods

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

**ConstantValue**(name As `String</api/data_types/string>`) As `String</api/data_types/string>`

> Gets the value of a constant in your control as a String.
>
> You can use the ConstantValue of a string stored in a constant, such as "kDescription".:
>
> ``` xojo
> Var s As String = ConstantValue("kDescription")
> g.DrawText(s, 25, 25)
> ```

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

**PictureConstant**(name As `String</api/data_types/string>`) As `Picture</api/graphics/picture>`

> Gets the value of a constant in your control as a Picture.
>
> You can use PictureConstant with the Base64 value (without the type header) of a picture stored in a constant, such as "kIcon":
>
> ``` xojo
> Var icon As Picture = PictureConstant("kIcon")
> g.DrawPicture(icon, 0, 0)
> ```

### Color Methods

**ColorGroup.NamedColor**(name As `String</api/data_types/string>`) As `Color</api/data_types/color>`

> When running on a platform that supports named colors (only macOS at the time of this writing), this method returns the named OS.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Color names are case sensitive, so the macOS secondary label color should be "secondaryLabelColor".
>
> </div>

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

**TextColor** As `Color</api/data_types/color>`

> Returns the current text color of the platform that the IDE is running on.

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

**FillColor** As `Color</api/data_types/color>`

> Returns the current fill color of the platform that the IDE is running on.

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

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

> Returns `True</api/language/true>` if the system is running in dark mode (only macOS at the time of this writing).

### Font Methods

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

> Returns the number of fonts available on the system.

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

**FontAt**(index As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Returns the name of the font at the specified *index*.

### CSS Methods

**CSSColorValue**(selector as `String</api/data_types/string>`, propertyName As `String</api/data_types/string>`, fallbackColor As `Color</api/data_types/color>`) As `Color</api/data_types/color>`

> Returns a Xojo color converted from whatever format was used in the CSS color definition. Automatically converts \#RRGGBB, rgb(1, 0, 0) and rgba(1, 0, 0, 0.5) style colors.

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

**CSSPixelValue**(selector As `String</api/data_types/string>`, propertyName As `String</api/data_types/string>`, fallbackValue As `Double</api/data_types/double>`) As `Double</api/data_types/double>`

> Returns a pixel value for a particular *selector* and property, making automatic adjustments for things that may be in units other than px. Useful for things that may be represented in millimeters, points or rems (rems is multiplied by the value of Body font-size).

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

**CSSStringValue**(selector As `String</api/data_types/string>`, propertyName As `String</api/data_types/string>`) As `String</api/data_types/string>`

> Returns the raw value of a particular *selector* and property.

### Other Methods

**DebugLog**(msg As `String</api/data_types/string>`)

> Sends *msg* to the Messages pane.

**Print**(msg As `String</api/data_types/string>`)

> Sends *msg* to the Messages pane.

## Compatibility

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

<div class="seealso">

`WebUIControl</api/user_interface/web/webuicontrol>` parent class

</div>
