Class

# MobileSegment

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

## Description

A single segment in a `MobileSegmentedButton</api/user_interface/mobile/mobilesegmentedbutton>` control.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                               | Type                               | Read-Only | Shared |
|------------------------------------|------------------------------------|-----------|--------|
| `Caption<mobilesegment.caption>`   | `String</api/data_types/string>`   |           |        |
| `Enabled<mobilesegment.enabled>`   | `Boolean</api/data_types/boolean>` |           |        |
| `Icon<mobilesegment.icon>`         | `Picture</api/graphics/picture>`   |           |        |
| `Selected<mobilesegment.selected>` | `Boolean</api/data_types/boolean>` |           |        |
| `Width<mobilesegment.width>`       | `Double</api/data_types/double>`   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters                                  | Returns | Shared |
|-------------------------------------------|---------------------------------------------|---------|--------|
| `Constructor<mobilesegment.constructor0>` | caption As `String</api/data_types/string>` |         |        |
| `Constructor<mobilesegment.constructor1>` | icon As `Picture</api/graphics/picture>`    |         |        |

## Property descriptions

<div id="mobilesegment.caption">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Caption

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

> The text that will appear in the segment.

<div id="mobilesegment.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Enabled

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

> `True</api/language/true>` if the <span class="title-ref">Segment</span> is enabled. The default is `True</api/language/true>`.
>
> This example disables the second <span class="title-ref">Segment</span>. It is in the Opening event of the `MobileSegmentedButton</api/user_interface/mobile/mobilesegmentedbutton>`.
>
> ``` xojo
> Var s As MobileSegment = Me.SegmentAt(1)
>
> s.Enabled = False
> ```

<div id="mobilesegment.icon">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Icon

**Icon** As `Picture</api/graphics/picture>`

> The icon/picture that will be displayed on the segment.

<div id="mobilesegment.selected">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Selected

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

> If `True</api/language/true>`, the segment is selected.

<div id="mobilesegment.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Width

**Width** As `Double</api/data_types/double>`

> The width of the segment.

## Method descriptions

<div id="mobilesegment.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Constructor

**Constructor**(caption 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">MobileSegment</span> with the *caption* passed.

<div id="mobilesegment.constructor1">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegment.Constructor

**Constructor**(icon As `Picture</api/graphics/picture>`)

> Creates a <span class="title-ref">MobileSegment</span> with the *icon* passed.

## Compatibility

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

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `MobileSegmentedButton</api/user_interface/mobile/mobilesegmentedbutton>` control.

</div>
