Class

# MobileTextField

<div class="rst-class">

forsearch

</div>

TextField

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

## Description

A single-line text field for text.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                                 | Type                                                          | Read-Only | Shared |
|----------------------------------------------------------------------|---------------------------------------------------------------|-----------|--------|
| `AccessibilityHint<mobiletextfield.accessibilityhint>`               | `String</api/data_types/string>`                              |           |        |
| `AccessibilityLabel<mobiletextfield.accessibilitylabel>`             | `String</api/data_types/string>`                              |           |        |
| `AdjustTextSizeToFit<mobiletextfield.adjusttextsizetofit>`           | `Boolean</api/data_types/boolean>`                            |           |        |
| `Alignment<mobiletextfield.alignment>`                               | `MobileTextControl.Alignments<mobiletextcontrol.alignments>`  |           |        |
| `AllowAutoCorrection<mobiletextfield.allowautocorrection>`           | `Boolean</api/data_types/boolean>`                            |           |        |
| `AllowSpellChecking<mobiletextfield.allowspellchecking>`             | `Boolean</api/data_types/boolean>`                            |           |        |
| `BorderStyle<mobiletextfield.borderstyle>`                           | `BorderStyles<mobiletextfield.borderstyles>`                  |           |        |
| `ControlCount<mobiletextfield.controlcount>`                         | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Enabled<mobiletextfield.enabled>`                                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `Height<mobiletextfield.height>`                                     | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Hint<mobiletextfield.hint>`                                         | `String</api/data_types/string>`                              |           |        |
| `HintColor<mobiletextfield.hintcolor>`                               | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `InputType<mobiletextfield.inputtype>`                               | `InputTypes<mobiletextfield.inputtypes>`                      |           |        |
| `Left<mobiletextfield.left>`                                         | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LockBottom<mobiletextfield.lockbottom>`                             | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockLeft<mobiletextfield.lockleft>`                                 | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockRight<mobiletextfield.lockright>`                               | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockTop<mobiletextfield.locktop>`                                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `MaximumCharactersAllowed<mobiletextfield.maximumcharactersallowed>` | `Integer</api/data_types/integer>`                            |           |        |
| `Name<mobiletextfield.name>`                                         | `String</api/data_types/string>`                              | ✓         |        |
| `Parent<mobiletextfield.parent>`                                     | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` | ✓         |        |
| `Password<mobiletextfield.password>`                                 | `Boolean</api/data_types/boolean>`                            |           |        |
| `ReadOnly<mobiletextfield.readonly>`                                 | `Boolean</api/data_types/boolean>`                            |           |        |
| `ReturnCaption<mobiletextfield.returncaption>`                       | `ReturnCaptions<mobiletextfield.returncaptions>`              |           |        |
| `SelectedText<mobiletextfield.selectedtext>`                         | `String</api/data_types/string>`                              |           |        |
| `SelectionLength<mobiletextfield.selectionlength>`                   | `Integer</api/data_types/integer>`                            |           |        |
| `SelectionStart<mobiletextfield.selectionstart>`                     | `Integer</api/data_types/integer>`                            |           |        |
| `Text<mobiletextfield.text>`                                         | `String</api/data_types/string>`                              |           |        |
| `TextColor<mobiletextfield.textcolor>`                               | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `TextFont<mobiletextfield.textfont>`                                 | `Font</api/graphics/font>`                                    |           |        |
| `TintColor<mobiletextfield.tintcolor>`                               | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `Top<mobiletextfield.top>`                                           | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Visible<mobiletextfield.visible>`                                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `Width<mobiletextfield.width>`                                       | `Integer</api/data_types/integer>`                            | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

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

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                 | Parameters                              | Returns                            |
|------------------------------------------------------|-----------------------------------------|------------------------------------|
| `Closing<mobiletextfield.closing>`                   |                                         |                                    |
| `FocusLost<mobiletextfield.focuslost>`               |                                         |                                    |
| `FocusReceived<mobiletextfield.focusreceived>`       |                                         |                                    |
| `KeyDown<mobiletextfield.keydown>`                   | key As `String</api/data_types/string>` | `Boolean</api/data_types/boolean>` |
| `Opening<mobiletextfield.opening>`                   |                                         |                                    |
| `ReturnPressed<mobiletextfield.returnpressed>`       |                                         | `Boolean</api/data_types/boolean>` |
| `SelectionChanged<mobiletextfield.selectionchanged>` |                                         |                                    |
| `TextChanged<mobiletextfield.textchanged>`           |                                         |                                    |

## Enumerations

<div id="mobiletextfield.borderstyles">

<div class="rst-class">

forsearch

</div>

</div>

MobileTextField.BorderStyles

### BorderStyles

> The various styles that can be set for the border of the control.
>
> | Enum        | Description                                                                    |
> |-------------|--------------------------------------------------------------------------------|
> | None        | The field has no border.                                                       |
> | Rectangular | The field has a rectangular border.                                            |
> | Bezel       | The field border makes the field appear inset. This is supported for iOS only. |
> | Rounded     | Like the Rectangular style but with slightly rounded corners.                  |

<div id="mobiletextfield.inputtypes">

<div class="rst-class">

forsearch

</div>

</div>

MobileTextField.InputTypes

### InputTypes

> The various of keyboards that can be displayed when the control has focus.
>
> | Enum                  | Android Description                                                                          | iOS Description                                            |
> |-----------------------|----------------------------------------------------------------------------------------------|------------------------------------------------------------|
> | Default               | Standard text entry.                                                                         | Standard text entry.                                       |
> | NumbersAndPunctuation | Allows entering signed numbers.                                                              | For entering numbers that may include formatting.          |
> | URL                   | For entering URLs.                                                                           | For entering URLs.                                         |
> | Numbers               | For entering only numbers. No decimals or any punctuation.                                   | For entering only numbers. No decimals or any punctuation. |
> | Phone                 | For entering phone numbers.                                                                  | For entering phone numbers.                                |
> | NamePhone             | Toggles between Default and Phone.                                                           | Toggles between Default and Phone.                         |
> | Email                 | For entering email addresses.                                                                | For entering email addresses.                              |
> | Decimal               | Numbers only but includes the decimal.                                                       | Numbers only but includes the decimal.                     |
> | Twitter               | Same as Default but no text substitutions.                                                   | Like Default but includes the @ and \# characters.         |
> | WebSearch             | Same as Default but no text substitutions.                                                   | Like Default but changes the Done button to Go.            |
> | None                  | Provides a way to ensure the soft keyboard won't appear. This is supported for Android only. |                                                            |

<div id="mobiletextfield.returncaptions">

<div class="rst-class">

forsearch

</div>

</div>

MobileTextField.ReturnCaptions

### ReturnCaptions

> The various of captions that can be used with the Return key on the keyboard.
>
> | Enum            |
> |-----------------|
> | Default         |
> | Go              |
> | Join            |
> | NextCaption     |
> | Route           |
> | Search          |
> | Send            |
> | Done            |
> | EmergencyCall   |
> | ContinueCaption |

## Property descriptions

<div id="mobiletextfield.accessibilityhint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.accessibilitylabel">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.adjusttextsizetofit">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.AdjustTextSizeToFit

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

> Automatically adjusts the text to the textfield's width when it's set to `True</api/language/true>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for Android.
>
> </div>

<div id="mobiletextfield.alignment">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Alignment

**Alignment** As `MobileTextControl.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="mobiletextfield.allowautocorrection">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.AllowAutoCorrection

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

> If `True</api/language/true>`, misspelled words will be automatically corrected as the user types.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobiletextfield.allowspellchecking">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.AllowSpellChecking

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

> If `True</api/language/true>`, misspelled words will be underlined in red.

<div id="mobiletextfield.borderstyle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.BorderStyle

**BorderStyle** As `BorderStyles<mobiletextfield.borderstyles>`

> The style in which the border of the textfield will be drawn.
>
> Any BorderStyle other than Rounded makes the TextField content background transparent.
>
> ``` xojo
> TextField1.BorderStyle = MobileTextField.BorderStyles.Rounded
> ```

<div id="mobiletextfield.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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 is supported for iOS only.
>
> </div>

<div id="mobiletextfield.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.height">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Height

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

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

<div id="mobiletextfield.hint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Hint

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

> Non-selectable, non-editable text that appears when the textfield is empty.
>
> The purpose of the hint is to give the user an idea of what information the field is expecting. This is particularly useful if the field does not have an associated label.
>
> ``` xojo
> LastNameField.Hint = "Last Name"
> ```

<div id="mobiletextfield.hintcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.HintColor

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

> The color of the hint in the control.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> For Android the color is only applied when the field gets focus.
>
> </div>

<div id="mobiletextfield.inputtype">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.InputType

**InputType** As `InputTypes<mobiletextfield.inputtypes>`

> Indicates the type of data to be input so that the mobile device can display the appropriate keyboard.
>
> ``` xojo
> PhoneField.InputType = MobileTextField.InputTypes.Phone
> ```

<div id="mobiletextfield.left">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Left

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

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

<div id="mobiletextfield.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.maximumcharactersallowed">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.MaximumCharactersAllowed

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

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

<div id="mobiletextfield.name">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Name

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

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

<div id="mobiletextfield.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.password">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Password

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

> If `True</api/language/true>`, each character will be masked as it's entered.

<div id="mobiletextfield.readonly">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.ReadOnly

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

> If `True</api/language/true>`, the contents of the field can be selected and copied but not changed.

<div id="mobiletextfield.returncaption">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.ReturnCaption

**ReturnCaption** As `ReturnCaptions<mobiletextfield.returncaptions>`

> The caption of the Return key when the keyboard is displayed.
>
> The caption you choose will be displayed on the keyboard only when the user is using it with this specific TextField.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>
>
> In the Opening event of a TextField, set Join as the caption for the return key:
>
> ``` xojo
> Me.ReturnCaption = MobileTextField.ReturnCaptions.Send
> ```

<div id="mobiletextfield.selectedtext">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.SelectedText

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

> The text that is selected.

<div id="mobiletextfield.selectionlength">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.SelectionLength

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

> The number of characters selected.

<div id="mobiletextfield.selectionstart">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.SelectionStart

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

> The position of the first character in the selected text.

<div id="mobiletextfield.text">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.textcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.textfont">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.tintcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.top">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Top

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

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

<div id="mobiletextfield.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Visible

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

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

<div id="mobiletextfield.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Width

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

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

## Method descriptions

<div id="mobiletextfield.addconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.addcontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.clearfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.ClearFocus

**ClearFocus**

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

<div id="MobileTextField.constraint">

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

</div>

<div class="rst-class">

forsearch

</div>

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

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.controls">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Handle

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

> The handle to the underlying native OS control.

<div id="mobiletextfield.refresh">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.removeconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.removecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.selectall">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.SelectAll

**SelectAll**

> Selects all text in the control.

<div id="mobiletextfield.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.SetFocus

**SetFocus**

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

## Event descriptions

<div id="mobiletextfield.closing">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.Closing

**Closing**

> Called when the control's layout is closing.

<div id="mobiletextfield.focuslost">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.FocusLost

**FocusLost**

> The <span class="title-ref">MobileTextField</span> has lost the focus.

<div id="mobiletextfield.focusreceived">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.FocusReceived

**FocusReceived**

> The <span class="title-ref">MobileTextField</span> has received the focus and has a selection rectangle around it.

<div id="mobiletextfield.keydown">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.KeyDown

**KeyDown**(key As `String</api/data_types/string>`) As `Boolean</api/data_types/boolean>`

> The user has pressed the *key* passed while the <span class="title-ref">MobileTextField</span> has the focus.
>
> Returning `True</api/language/true>` means the key is intercepted, preventing the key from actually reaching the control at all. This would be useful if you want to override the behavior of the tab key for example. Returning `False</api/language/false>` means the key reaches the control.

<div id="mobiletextfield.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.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="mobiletextfield.returnpressed">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.ReturnPressed

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

> The Return key was pressed on the keyboard.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> On Android, returning `False</api/language/false>` will dismiss the keyboard.
>
> </div>

<div id="mobiletextfield.selectionchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.SelectionChanged

**SelectionChanged**

> The range of characters highlighted has changed.

<div id="mobiletextfield.textchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileTextField.TextChanged

**TextChanged**

> Called when the text changes from user entry. It is not called when the text is changed via code.
>
> Update a label with the text as it is being entered:
>
> ``` xojo
> NameLabel.Text = Me.Text
> ```

## Compatibility

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

<div class="seealso">

`MobileTextControl</api/user_interface/mobile/mobiletextcontrol>` parent class; `MobileTextArea</api/user_interface/mobile/mobiletextarea>` control

</div>
