Class

# WebBarcode

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

## Description

Uses the device's camera to read any bar code types supported by the device.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                | Type                                       | Read-Only | Shared |
|-------------------------------------|--------------------------------------------|-----------|--------|
| `ControlID<webbarcode.controlid>`   | `String</api/data_types/string>`           | ✓         |        |
| `Enabled<webbarcode.enabled>`       | `Boolean</api/data_types/boolean>`         |           |        |
| `FullScreen<webbarcode.fullscreen>` | `Boolean</api/data_types/boolean>`         |           |        |
| `Name<webbarcode.name>`             | `String</api/data_types/string>`           | ✓         |        |
| `Page<webbarcode.page>`             | `WebPage</api/user_interface/web/webpage>` | ✓         |        |
| `PanelIndex<webbarcode.panelindex>` | `Integer</api/data_types/integer>`         |           |        |
| `Parent<webbarcode.parent>`         | `WebView</api/user_interface/web/webview>` | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                              | Parameters                                                                                                                                                                                                    | Returns                          | Shared |
|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|--------|
| `Close<webbarcode.close>`                         |                                                                                                                                                                                                               |                                  |        |
| `ExecuteJavaScript<webbarcode.executejavascript>` | script As `String</api/data_types/string>`                                                                                                                                                                    |                                  |        |
| `FromImage<webbarcode.fromimage>`                 | image As `Picture</api/graphics/picture>`                                                                                                                                                                     | String()                         | ✓      |
| `GoToURL<webbarcode.gotourl>`                     | url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                                                                                     |                                  |        |
| `Image<webbarcode.image>`                         | value As `String</api/data_types/string>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, type As `Barcode.Types<barcode.types>` = `Barcode.Types<barcode.types>` | `Picture</api/graphics/picture>` | ✓      |
| `StartScan<webbarcode.startscan>`                 |                                                                                                                                                                                                               |                                  |        |
| `StopScan<webbarcode.stopscan>`                   |                                                                                                                                                                                                               |                                  |        |
| `UpdateBrowser<webbarcode.updatebrowser>`         |                                                                                                                                                                                                               |                                  |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters                                | Returns |
|-------------------------------------------|-------------------------------------------|---------|
| `Closed<webbarcode.closed>`               |                                           |         |
| `Opening<webbarcode.opening>`             |                                           |         |
| `ScanCancelled<webbarcode.scancancelled>` |                                           |         |
| `ScanCompleted<webbarcode.scancompleted>` | value As `String</api/data_types/string>` |         |
| `ScanFailed<webbarcode.scanfailed>`       |                                           |         |

## Property descriptions

<div id="webbarcode.controlid">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.ControlID

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

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

<div id="webbarcode.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.Enabled

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

> When `True</api/language/true>` the <span class="title-ref">WebControl</span> 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="webbarcode.fullscreen">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.FullScreen

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

> If `True</api/language/true>` the <span class="title-ref">barcode</span> scanner will appear full screen.
>
> This can be changed even while the <span class="title-ref">barcode</span> scanner is already displayed.

<div id="webbarcode.name">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.Name

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

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

<div id="webbarcode.page">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.Page

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

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

<div id="webbarcode.panelindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.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="webbarcode.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

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

## Method descriptions

<div id="webbarcode.close">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.Close

**Close**

> Removes the control from the page.

<div id="webbarcode.executejavascript">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.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="webbarcode.fromimage">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.FromImage

**FromImage**(image As `Picture</api/graphics/picture>`) As String()

> Returns an array of the unique identifiers from all detected <span class="title-ref">barcodes</span> in the *image* provided.
>
> This method is `shared</api/language/shared>`.

<div id="webbarcode.gotourl">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.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="webbarcode.image">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.Image

**Image**(value As `String</api/data_types/string>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, type As `Barcode.Types<barcode.types>` = `Barcode.Types<barcode.types>`) As `Picture</api/graphics/picture>`

> Returns an image with the value encoded as the specified type of <span class="title-ref">barcode</span>.
>
> This method is `shared</api/language/shared>`.

<div id="webbarcode.startscan">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.StartScan

**StartScan**

> Opens the scanning user interface provided by the device to scan a <span class="title-ref">barcode</span>. The device will auto-detect the type of <span class="title-ref">barcode</span>.

<div id="webbarcode.stopscan">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.StopScan

**StopScan**

> Stops the process of scanning <span class="title-ref">barcodes</span> and closes the scanning user interface on the device.

<div id="webbarcode.updatebrowser">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.UpdateBrowser

**UpdateBrowser**

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

## Event descriptions

<div id="webbarcode.closed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.Closed

**Closed**

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

<div id="webbarcode.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

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

<div id="webbarcode.scancancelled">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.ScanCancelled

**ScanCancelled**

> The user canceled the scan.

<div id="webbarcode.scancompleted">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.ScanCompleted

**ScanCompleted**(value As `String</api/data_types/string>`)

> A <span class="title-ref">barcode</span> was successfully scanned. The *value* is the unique identifier scanned.

<div id="webbarcode.scanfailed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebBarcode.ScanFailed

**ScanFailed**

> The scan was not able to complete.

## Notes

### Supported <span class="title-ref">barcode</span> types

The following types of <span class="title-ref">barcodes</span> are supported:

| Type            | Description                                                                                                                                                                                                                              |
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Aztec           | Two-dimensional <span class="title-ref">Barcodes</span> and has a characteristic square pattern in the middle. This Code is widely used by railway companies in their ticketing systems.                                                 |
| Codabar         | Codabar can encode the digits 0-9, several special characters (- \$ : / . +), as well as special start and stop characters (A, B, C, D). These start and stop characters are required to clearly mark the beginning and end of the code. |
| Code39          | Widely used in a variety of industries and is part of of many governmental specifications. It encodes a set of alphanumeric symbols.                                                                                                     |
| Code93          | Encodes numerical input, as well as capital letters and some special characters. It used by Canada Post for additional delivery information.                                                                                             |
| Code128         | Universal <span class="title-ref">barcode</span> with excellent data density. It is used, for example, in shipping and packaging.                                                                                                        |
| Data Matrix     | Two-dimensional Code that may contain text, numbers or binary data. It is widely used for labeling small electronic components or in food production, but also on mail labels.                                                           |
| EAN8            | Derived from the longer European Article Number (EAN-13) code. It was introduced for use on small packages where an EAN-13 <span class="title-ref">barcode</span> would be too large.                                                    |
| EAN13           | Codes are widely used in retail across Europe. There are several versions of EAN encoding 2, 5, 7 or 12 digits.                                                                                                                          |
| Interleaved2of5 | Developed on the basis of Industrial Code 2 of 5 and only encodes an even number of digits. It is used in warehousing and industrial applications.                                                                                       |
| ITF14           | Also called SCC-14 is used to mark shipping containers. It is also placed on cartons and pallets and signifies the type of products transported.                                                                                         |
| PDF417          | Suitable for storing large amounts of data due to its two-dimensional structure. It is widely used for labeling electronic equipment or hazardous materials, but also on personal IDs.                                                   |
| QR              | Applications include product tracking, item identification, time tracking, document management, and general marketing.                                                                                                                   |
| UPC-A           | Contains 12 digits, no letters or other characters. The UPC-A barcode is by far the most common and well-known symbology, especially in the United States.                                                                               |
| UPC-E           | Only has 8 digits and is used instead of UPC-A on smaller products. It is similarly used in retail and warehousing, especially in the USA and Canada.                                                                                    |

## Compatibility

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

<div class="seealso">

`WebControl</api/user_interface/web/webcontrol>` parent class; `Barcode</api/hardware/barcode>` class

</div>
