Class

# MobileTextControl

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

## Description

The parent class of `MobileTextField</api/user_interface/mobile/mobiletextfield>`, `MobileTextArea</api/user_interface/mobile/mobiletextarea>` and `MobileLabel</api/user_interface/mobile/mobilelabel>`.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                                   | Type                                                          | Read-Only | Shared |
|------------------------------------------------------------------------|---------------------------------------------------------------|-----------|--------|
| `AccessibilityHint<mobiletextcontrol.accessibilityhint>`               | `String</api/data_types/string>`                              |           |        |
| `AccessibilityLabel<mobiletextcontrol.accessibilitylabel>`             | `String</api/data_types/string>`                              |           |        |
| `Alignment<mobiletextcontrol.alignment>`                               | `Alignments<mobiletextcontrol.alignments>`                    |           |        |
| `ControlCount<mobiletextcontrol.controlcount>`                         | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Enabled<mobiletextcontrol.enabled>`                                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `Height<mobiletextcontrol.height>`                                     | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Left<mobiletextcontrol.left>`                                         | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LockBottom<mobiletextcontrol.lockbottom>`                             | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockLeft<mobiletextcontrol.lockleft>`                                 | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockRight<mobiletextcontrol.lockright>`                               | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockTop<mobiletextcontrol.locktop>`                                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `MaximumCharactersAllowed<mobiletextcontrol.maximumcharactersallowed>` | `Integer</api/data_types/integer>`                            |           |        |
| `Name<mobiletextcontrol.name>`                                         | `String</api/data_types/string>`                              | ✓         |        |
| `Parent<mobiletextcontrol.parent>`                                     | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` | ✓         |        |
| `SelectedText<mobiletextcontrol.selectedtext>`                         | `String</api/data_types/string>`                              |           |        |
| `Text<mobiletextcontrol.text>`                                         | `String</api/data_types/string>`                              |           |        |
| `TextColor<mobiletextcontrol.textcolor>`                               | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `TextFont<mobiletextcontrol.textfont>`                                 | `Font</api/graphics/font>`                                    |           |        |
| `TintColor<mobiletextcontrol.tintcolor>`                               | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `Top<mobiletextcontrol.top>`                                           | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Visible<mobiletextcontrol.visible>`                                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `Width<mobiletextcontrol.width>`                                       | `Integer</api/data_types/integer>`                            | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                   | Parameters                                                                                                                                                | Returns                                                       | Shared |
|--------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|--------|
| `AddConstraint<mobiletextcontrol.addconstraint>`       | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`, name As `String</api/data_types/string>` = ""                                          |                                                               |        |
| `AddControl<mobiletextcontrol.addcontrol>`             | child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`, isBeingAdded As `Boolean</api/data_types/boolean>` = `False</api/language/false>` |                                                               |        |
| `ClearFocus<mobiletextcontrol.clearfocus>`             |                                                                                                                                                           |                                                               |        |
| `Constraint<mobiletextcontrol.constraint>`             | name As `String</api/data_types/string>`                                                                                                                  | `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`           |        |
| `ControlAt<mobiletextcontrol.controlat>`               | index As `Integer</api/data_types/integer>`                                                                                                               | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` |        |
| `Controls<mobiletextcontrol.controls>`                 |                                                                                                                                                           | `Iterable</api/language/iterable>`                            |        |
| `Handle<mobiletextcontrol.handle>`                     |                                                                                                                                                           | `Ptr</api/data_types/additional_types/ptr>`                   |        |
| `Refresh<mobiletextcontrol.refresh>`                   |                                                                                                                                                           |                                                               |        |
| `RemoveConstraint<mobiletextcontrol.removeconstraint>` | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`                                                                                         |                                                               |        |
|                                                        | name As `String</api/data_types/string>`                                                                                                                  |                                                               |        |
| `RemoveControl<mobiletextcontrol.removecontrol>`       | child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`                                                                                    |                                                               |        |
| `SetFocus<mobiletextcontrol.setfocus>`                 |                                                                                                                                                           |                                                               |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                 | Parameters | Returns |
|--------------------------------------|------------|---------|
| `Closing<mobiletextcontrol.closing>` |            |         |
| `Opening<mobiletextcontrol.opening>` |            |         |

## Enumerations

<div id="mobiletextcontrol.alignments">

<div class="rst-class">

forsearch

</div>

</div>

MobileTextControl.Alignments

### Alignments

> The text alignments available to the control.
>
> | Enum      |
> |-----------|
> | Left      |
> | Center    |
> | Right     |
> | Justified |
> | Natural   |

<div id="mobiletextcontrol.autocapitalizationtypes">

<div class="rst-class">

forsearch

</div>

</div>

MobileTextControl.AutoCapitalizationTypes

### AutoCapitalizationTypes

> The capitalization types available to the control.
>
> | Enum           |
> |----------------|
> | None           |
> | Words          |
> | Sentences      |
> | All Characters |

## Property descriptions

<div id="mobiletextcontrol.accessibilityhint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.accessibilitylabel">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.alignment">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Alignment

**Alignment** As `Alignments<mobiletextcontrol.alignments>`

> Specifies the alignment of the text in the control.
>
> This code in the control's `Opening<mobilecontrol.opening>` event sets the alignment to justified:
>
> ``` xojo
> Me.Alignment = MobileTextControl.Alignments.Justified
> ```

<div id="mobiletextcontrol.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.height">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Height

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

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

<div id="mobiletextcontrol.left">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Left

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

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

<div id="mobiletextcontrol.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.maximumcharactersallowed">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.MaximumCharactersAllowed

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

> The maximum number of characters allowed in the <span class="title-ref">MobileTextControl</span>.
>
> The value of zero does not limit text.
>
> There may be maximum limits imposed by the operating system.

<div id="mobiletextcontrol.name">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Name

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

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

<div id="mobiletextcontrol.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.selectedtext">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.SelectedText

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

> The text that is selected.

<div id="mobiletextcontrol.text">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Text

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

> The text in the control.
>
> The following code sets the text of the control in any of its events:
>
> ``` xojo
> Me.Text = "One ring to rule them all..."
> ```

<div id="mobiletextcontrol.textcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.TextColor

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

> The color of the text in the control.
>
> Placed in any of the control's events, this code changes the text color to blue:
>
> ``` xojo
> Me.TextColor = Color.Blue
> ```

<div id="mobiletextcontrol.textfont">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.TextFont

**TextFont** As `Font</api/graphics/font>`

> A `Font</api/graphics/font>` object that provides information about the control's font name, font size, and more.
>
> From any of the control's events, this example changes the font:
>
> ``` xojo
> Me.TextFont = Font.BoldSystemFont(20)
> ```

<div id="mobiletextcontrol.tintcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.TintColor

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

> Changes a control's tint color.
>
> 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="mobiletextcontrol.top">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Top

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

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

<div id="mobiletextcontrol.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Visible

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

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

<div id="mobiletextcontrol.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Width

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

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

## Method descriptions

<div id="mobiletextcontrol.addconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.addcontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.clearfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.ClearFocus

**ClearFocus**

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

<div id="mobiletextcontrol.constraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.controlat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.controls">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Handle

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

> The handle to the underlying native OS control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobiletextcontrol.refresh">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.removeconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.removecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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="mobiletextcontrol.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.SetFocus

**SetFocus**

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

## Event descriptions

<div id="mobiletextcontrol.closing">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.Closing

**Closing**

> alled when the control's layout is closing.

<div id="mobiletextcontrol.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextControl.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"
> ```

## Notes

You cannot instantiate <span class="title-ref">MobileTextControl</span> directly.

<span class="title-ref">MobileTextControl</span> cannot be subclassed on Android.

## Compatibility

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

<div class="seealso">

`MobileUIControl</api/user_interface/mobile/mobileuicontrol>` parent class; `MobileTextField</api/user_interface/mobile/mobiletextfield>`, `MobileTextArea</api/user_interface/mobile/mobiletextarea>` and `MobileLabel</api/user_interface/mobile/mobilelabel>` controls.

</div>
