Class

# MobileSegmentedButton

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

## Description

A horizontal button made up of multiple, independent segments.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                               | Type                                                          | Read-Only | Shared |
|--------------------------------------------------------------------|---------------------------------------------------------------|-----------|--------|
| `AccessibilityHint<mobilesegmentedbutton.accessibilityhint>`       | `String</api/data_types/string>`                              |           |        |
| `AccessibilityLabel<mobilesegmentedbutton.accessibilitylabel>`     | `String</api/data_types/string>`                              |           |        |
| `ControlCount<mobilesegmentedbutton.controlcount>`                 | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Enabled<mobilesegmentedbutton.enabled>`                           | `Boolean</api/data_types/boolean>`                            |           |        |
| `Height<mobilesegmentedbutton.height>`                             | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LastSegmentIndex<mobilesegmentedbutton.lastsegmentindex>`         | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Left<mobilesegmentedbutton.left>`                                 | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LockBottom<mobilesegmentedbutton.lockbottom>`                     | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockLeft<mobilesegmentedbutton.lockleft>`                         | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockRight<mobilesegmentedbutton.lockright>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockTop<mobilesegmentedbutton.locktop>`                           | `Boolean</api/data_types/boolean>`                            |           |        |
| `Name<mobilesegmentedbutton.name>`                                 | `String</api/data_types/string>`                              | ✓         |        |
| `Parent<mobilesegmentedbutton.parent>`                             | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` | ✓         |        |
| `SegmentCount<mobilesegmentedbutton.segmentcount>`                 | `Integer</api/data_types/integer>`                            |           |        |
| `SelectedSegment<mobilesegmentedbutton.selectedsegment>`           | `MobileSegment</api/user_interface/mobile/mobilesegment>`     |           |        |
| `SelectedSegmentIndex<mobilesegmentedbutton.selectedsegmentindex>` | `Integer</api/data_types/integer>`                            |           |        |
| `TintColor<mobilesegmentedbutton.tintcolor>`                       | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `Top<mobilesegmentedbutton.top>`                                   | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Visible<mobilesegmentedbutton.visible>`                           | `Boolean</api/data_types/boolean>`                            |           |        |
| `Width<mobilesegmentedbutton.width>`                               | `Integer</api/data_types/integer>`                            | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                             | Parameters                                                                                                                                                | Returns                                                       | Shared |
|------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|--------|
| `AddConstraint<mobilesegmentedbutton.addconstraint>`             | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`, name As `String</api/data_types/string>` = ""                                          |                                                               |        |
| `AddControl<mobilesegmentedbutton.addcontrol>`                   | child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`, isBeingAdded As `Boolean</api/data_types/boolean>` = `False</api/language/false>` |                                                               |        |
| `AddSegment<mobilesegmentedbutton.addsegment>`                   | item As `MobileSegment</api/user_interface/mobile/mobilesegment>`                                                                                         |                                                               |        |
| `AddSegmentAt<mobilesegmentedbutton.addsegmentat>`               | index As `Integer</api/data_types/integer>`, item As `MobileSegment</api/user_interface/mobile/mobilesegment>`                                            |                                                               |        |
| `ClearFocus<mobilesegmentedbutton.clearfocus>`                   |                                                                                                                                                           |                                                               |        |
| `Constraint<mobilesegmentedbutton.constraint>`                   | name As `String</api/data_types/string>`                                                                                                                  | `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`           |        |
| `ControlAt<mobilesegmentedbutton.controlat>`                     | index As `Integer</api/data_types/integer>`                                                                                                               | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` |        |
| `Controls<mobilesegmentedbutton.controls>`                       |                                                                                                                                                           | `Iterable</api/language/iterable>`                            |        |
| `Handle<mobilesegmentedbutton.handle>`                           |                                                                                                                                                           | `Ptr</api/data_types/additional_types/ptr>`                   |        |
| `Refresh<mobilesegmentedbutton.refresh>`                         |                                                                                                                                                           |                                                               |        |
| `ResizeSegmentsToFit<mobilesegmentedbutton.resizesegmentstofit>` |                                                                                                                                                           |                                                               |        |
| `RemoveAllSegments<mobilesegmentedbutton.removeallsegments>`     |                                                                                                                                                           |                                                               |        |
| `RemoveConstraint<mobilesegmentedbutton.removeconstraint>`       | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`                                                                                         |                                                               |        |
|                                                                  | name As `String</api/data_types/string>`                                                                                                                  |                                                               |        |
| `RemoveControl<mobilesegmentedbutton.removecontrol>`             | child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`                                                                                    |                                                               |        |
| `RemoveSegment<mobilesegmentedbutton.removesegment>`             | item As `MobileSegment</api/user_interface/mobile/mobilesegment>`                                                                                         |                                                               |        |
| `RemoveSegmentAt<mobilesegmentedbutton.removesegmentat>`         | index As `Integer</api/data_types/integer>`                                                                                                               |                                                               |        |
| `SegmentAt<mobilesegmentedbutton.segmentat>`                     | index As `Integer</api/data_types/integer>`                                                                                                               | `MobileSegment</api/user_interface/mobile/mobilesegment>`     |        |
| `SetFocus<mobilesegmentedbutton.setfocus>`                       |                                                                                                                                                           |                                                               |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                     | Parameters                                            | Returns |
|------------------------------------------|-------------------------------------------------------|---------|
| `Closing<mobilesegmentedbutton.closing>` |                                                       |         |
| `Opening<mobilesegmentedbutton.opening>` |                                                       |         |
| `Pressed<mobilesegmentedbutton.pressed>` | segementedIndex As `Integer</api/data_types/integer>` |         |

## Property descriptions

<div id="mobilesegmentedbutton.accessibilityhint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.AccessibilityHint

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

> The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.
>
> ``` xojo
> Me.AccessibilityHint = "Click to calculate the value and display the next screen."
> ```
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for Android.
>
> </div>

<div id="mobilesegmentedbutton.accessibilitylabel">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.AccessibilityLabel

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

> The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.
>
> ``` xojo
> Me.AccessibilityLabel = "Calculate the value."
> ```

<div id="mobilesegmentedbutton.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.ControlCount

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

> The number of child controls in the control.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Enabled

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

> Indicates whether the control is enabled or disabled.
>
> Disable the button:
>
> ``` xojo
> Button1.Enabled = False
> ```

<div id="mobilesegmentedbutton.height">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Height

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

> The height of the control.
>
> This property is read-only on iOS.

<div id="mobilesegmentedbutton.lastsegmentindex">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.LastSegmentIndex

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

> The number of the last `Segment</api/user_interface/mobile/mobilesegment>` of the <span class="title-ref">MobileSegmentedButton</span>.
>
> This property is read-only.

<div id="mobilesegmentedbutton.left">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Left

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

> The left position of the control.
>
> This property is read-only on iOS.

<div id="mobilesegmentedbutton.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.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 screen.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockBottom = True
> ```

<div id="mobilesegmentedbutton.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.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 screen.
>
> LockLeft and Locktop default to `True</api/language/true>` when you add a new control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. *LockLeft* has no effect unless *LockRight* is `True</api/language/true>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockLeft = True
> ```

<div id="mobilesegmentedbutton.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.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 screen.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockRight = True
> ```

<div id="mobilesegmentedbutton.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.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 screen.
>
> LockTop and LockLeft default to `True</api/language/true>` when you add a control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. *LockTop* has no effect unless *LockBottom* is `True</api/language/true>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockTop = True
> ```

<div id="mobilesegmentedbutton.name">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Name

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

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

<div id="mobilesegmentedbutton.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Parent

**Parent** As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`

> The parent (sometimes called a "Super") class of the control.
>
> This property is read-only.

<div id="mobilesegmentedbutton.segmentcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.SegmentCount

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

> The number of segments.

<div id="mobilesegmentedbutton.selectedsegment">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.SelectedSegment

**SelectedSegment** As `MobileSegment</api/user_interface/mobile/mobilesegment>`

> The currently selected segment.

<div id="mobilesegmentedbutton.selectedsegmentindex">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.SelectedSegmentIndex

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

> The index of the selected segment.

<div id="mobilesegmentedbutton.tintcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.TintColor

**TintColor** As `ColorGroup</api/graphics/colorgroup>`

> Changes a control's tint color.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>
>
> On iOS, the following controls support TintColor:
>
> | Enum        | Description                                                                  |
> |-------------|------------------------------------------------------------------------------|
> | PopupMenu   | The background color will be drawn in the TintColor.                         |
> | ProgressBar | The area indicating the value of the control will be drawn in the TintColor. |
> | Slider      | The area indicating the value of the control will be drawn in the TintColor. |
> | TextArea    | The cursor and text highlight color will be drawn in the TintColor.          |
> | TextField   | The cursor and text highlight color will be drawn in the TintColor.          |

<div id="mobilesegmentedbutton.top">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Top

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

> The top position of the control.
>
> This property is read-only on iOS.

<div id="mobilesegmentedbutton.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Visible

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

> Indicates whether the control is visible.
>
> Make a button invisible:
>
> ``` xojo
> Button1.Visible = False
> ```

<div id="mobilesegmentedbutton.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Width

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

> The width of the control.
>
> This property is read-only on iOS.

## Method descriptions

<div id="mobilesegmentedbutton.addconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.AddConstraint

**AddConstraint**(constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`, name As `String</api/data_types/string>` = "")

> Adds a *constraint* to the control. The optional *name* parameter can be used to `remove a constraint<mobileuicontrol.removeconstraint>` that was added via code.
>
> This *constraint* is used by child controls that have been added to this control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.addcontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.AddControl

**AddControl**(child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`, isBeingAdded As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Adds a *child* control to the control. When the value of *isBeingAdded* is `True</api/language/true>`, the Opening event is triggered for the child control being added.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.addsegment">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.AddSegment

**AddSegment**(item As `MobileSegment</api/user_interface/mobile/mobilesegment>`)

> Adds a segment to the end.
>
> Add segments in the Opening event:
>
> ``` xojo
> Me.AddSegment(New MobileSegment("Earth"))
> Me.AddSegment(New MobileSegment("Sun"))
> Me.AddSegment(New MobileSegment("Moon"))
> ```

<div id="mobilesegmentedbutton.addsegmentat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.AddSegmentAt

**AddSegmentAt**(index As `Integer</api/data_types/integer>`, item As `MobileSegment</api/user_interface/mobile/mobilesegment>`)

> Adds the segment passed at the *index* passed.
>
> Add a segment at the beginning:
>
> ``` xojo
> Var item As New MobileSegment("Moon")
> SegmentedButton1.AddSegmentAt(0, item)
> ```

<div id="mobilesegmentedbutton.clearfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.ClearFocus

**ClearFocus**

> Removes the focus from the control.
>
> ``` xojo
> TextField1.ClearFocus
> ```

<div id="mobilesegmentedbutton.constraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Constraint

**Constraint**(name As `String</api/data_types/string>`) As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`

> Gets a reference to a named constraint so that you can modify its settings in code.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>
>
> Change an existing (and named) constraint of a control on the Screen:
>
> ``` xojo
> ' "TAWidth" is a width constraint for a TextField that has been given
> ' a name in the auto-layout Inspector properties.
> Var c As iOSLayoutConstraint = Self.Constraint("TAWidth")
> c.Offset = 200
> ```

<div id="mobilesegmentedbutton.controlat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.ControlAt

**ControlAt**(index As `Integer</api/data_types/integer>`) As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`

> Gets the child control at the specified *index*.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.controls">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Controls

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

> Allows you to iterate through all the controls that have been added to this control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> The handle to the underlying native OS control.

<div id="mobilesegmentedbutton.refresh">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Refresh

**Refresh**

> Marks the control so that it will be redrawn during the next event loop.
>
> Call Refresh to force a Canvas to redraw itself:
>
> ``` xojo
> Canvas1.Refresh
> ```

<div id="mobilesegmentedbutton.resizesegmentstofit">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.ResizeSegmentsToFit

**ResizeSegmentsToFit**

> Sizes the control to fit into its space, increasing or decreasing its width as necessary. Use this after making changes to the `MobileSegment</api/user_interface/mobile/mobilesegment>` width.
>
> If you add a new segment, the SegmentedButton does not resize to fit it so you need to call ResizeSegmentsToFit:
>
> ``` xojo
> ' Add a new MobileSegment
> Var seg As New MobileSegment
> seg.Caption = "Another"
> SegmentedButton1.AddSegment(seg)
>
> SegmentedButton1.ResizeSegmentsToFit
> ```

<div id="mobilesegmentedbutton.removeallsegments">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.RemoveAllSegments

**RemoveAllSegments**

> Removes all segments.
>
> Example:
>
> ``` xojo
> Me.RemoveAllSegments
> ```

<div id="mobilesegmentedbutton.removeconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.RemoveConstraint

**RemoveConstraint**(constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`)

> Removes a *constraint* from the control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

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

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

> Removes the constraint with the *name* passed from the `Screen</api/user_interface/mobile/mobilescreen>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.removecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.RemoveControl

**RemoveControl**(child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`)

> Removes the control from the control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesegmentedbutton.removesegment">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.RemoveSegment

**RemoveSegment**(item As `MobileSegment</api/user_interface/mobile/mobilesegment>`)

> Removes the segment passed.
>
> Removes a specific segment:
>
> ``` xojo
> ' MoonSegment is a property of type MobileSegment that
> ' was previously added to the MobileSegmentedButton control.
> SegmentedButton1.RemoveSegment(MoonSegment)
> ```

<div id="mobilesegmentedbutton.removesegmentat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.RemoveSegmentAt

**RemoveSegmentAt**(index As `Integer</api/data_types/integer>`)

> Removes the segment at the *index* passed.
>
> Remove the first segment:
>
> ``` xojo
> SegmentedButton1.RemoveSegmentAt(0)
> ```

<div id="mobilesegmentedbutton.segmentat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.SegmentAt

**SegmentAt**(index As `Integer</api/data_types/integer>`) As `MobileSegment</api/user_interface/mobile/mobilesegment>`

> Returns the `MobileSegment</api/user_interface/mobile/mobilesegment>` at the *index* passed.

<div id="mobilesegmentedbutton.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.SetFocus

**SetFocus**

> Sets the focus to the control.
>
> ``` xojo
> TextField1.SetFocus
> ```

## Event descriptions

<div id="mobilesegmentedbutton.closing">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Closing

**Closing**

> Called when the control's layout is closing.

<div id="mobilesegmentedbutton.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Opening

**Opening**

> Called when the control's layout is opening.
>
> This is where you typically put initialization code.
>
> This example in the Opening event of a label sets its text to "Hello":
>
> ``` xojo
> Me.Text = "Hello"
> ```

<div id="mobilesegmentedbutton.pressed">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileSegmentedButton.Pressed

**Pressed**(segementedIndex As `Integer</api/data_types/integer>`)

> Called when the selected segment is pressed.

## Interfaces

This class implements the `Iterable</api/language/iterable>` class interface.

## Notes

### Iterating through a <span class="title-ref">MobileSegmentedButton</span>

To iterate through the segments of a <span class="title-ref">MobileSegmentedButton</span>, use the `MobileSegment</api/user_interface/mobile/mobilesegment>` class.

## Compatibility

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

<div class="seealso">

`MobileUIControl</api/user_interface/mobile/mobileuicontrol>` parent class; `MobileSegment</api/user_interface/mobile/mobilesegment>` class

</div>
