Class

# WebListBoxStyleRenderer

<div class="rst-class">

forsearch

</div>

Listbox

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

## Description

Allows `` WebStyle</api/user_interface/web/webstyle>`s to be used on cells in a :doc:`WebListBox</api/user_interface/web/weblistbox> ``.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                         | Type                               | Read-Only | Shared |
|----------------------------------------------|------------------------------------|-----------|--------|
| `CellOnly<weblistboxstylerenderer.cellonly>` | `Boolean</api/data_types/boolean>` |           |        |
| `Value<weblistboxstylerenderer.value>`       | `String</api/data_types/string>`   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                | Parameters                                                                                       | Returns | Shared |
|-----------------------------------------------------|--------------------------------------------------------------------------------------------------|---------|--------|
| `Constructor<weblistboxstylerenderer.constructor0>` | style As `WebStyle</api/user_interface/web/webstyle>`, value As `String</api/data_types/string>` |         |        |

## Property descriptions

<div id="weblistboxstylerenderer.cellonly">

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

</div>

<div class="rst-class">

forsearch

</div>

WebListBoxStyleRenderer.CellOnly

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

> If `True</api/language/true>`, the `WebStyle</api/user_interface/web/webstyle>` affects the designated cell only. If `False</api/language/false>`, the `WebStyle</api/user_interface/web/webstyle>` is applied to the entire row.
>
> The default value is `True</api/language/true>`, thus styles applied affect the designated cell only by default.

<div id="weblistboxstylerenderer.value">

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

</div>

<div class="rst-class">

forsearch

</div>

WebListBoxStyleRenderer.Value

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

> The default value for any cell to which the WebListBoxCellRenderer is assigned.

## Method descriptions

<div id="weblistboxstylerenderer.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

WebListBoxStyleRenderer.Constructor

**Constructor**(style As `WebStyle</api/user_interface/web/webstyle>`, value As `String</api/data_types/string>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a <span class="title-ref">WebListBoxStyleRenderer</span> from the values passed.

## Notes

If you indicate a font in the `WebStyle</api/user_interface/web/webstyle>`, it must be available to the user's browser. That means it must be:

- Installed in the browser
- Installed on the device
- Downloaded at runtime

To download fonts at runtime, you must include a URL for the font in the `WebApplication<webapplication.htmlheader>` property. This can be done in the IDE via the Inspector. [Google](https://fonts.google.com) one of several places where you can find fonts that can be used freely. There you can choose fonts and get a URL for embedding the fonts at runtime in your application.

Applied `` WebStyle</api/user_interface/web/webstyle>`s affect the entire row. If you want the style to affect a specific cell, set the :ref:`CellOnly<weblistboxstylerenderer.cellonly> `` property to `True</api/language/true>`.

## Sample code

This example in the `Opening<webcontrol.opening>` event of a `WebListBox</api/user_interface/web/weblistbox>` adds a blank row, creates a `WebStyle</api/user_interface/web/webstyle>`, adds it to the <span class="title-ref">WebListBoxStyleRenderer</span> along with some sample text and then assigns it to the cell of the `WebListBox</api/user_interface/web/weblistbox>`:

``` xojo
'Create an empty row
Me.AddRow("")

'Create a webstyle
Var style As New WebStyle
style.BackgroundColor = Color.Yellow
style.BorderColor = Color.Green
style.BorderThickness = 3
Style.Bold = True

'Create a renderer from the webstyle and some text
Var cellRenderer As New WebListBoxStyleRenderer(style, "Hello World!")

'Assign the renderer to the cell
Me.CellRendererAt(0,0) = cellRenderer
```

## Compatibility

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

<div class="seealso">

`WebListBoxCellRenderer</api/web/weblistboxcellrenderer>` parent class; `WebListBox</api/user_interface/web/weblistbox>` control; `WebStyle</api/user_interface/web/webstyle>`, `WebListBoxCellRenderer</api/web/weblistboxcellrenderer>`, `WebListBoxImageRenderer</api/web/weblistboximagerenderer>`, and `WebListBoxDateTimeRenderer</api/web/weblistboxdatetimerenderer>` classes.

</div>
