Class

# MobileDateTimePicker

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

## Description

Control for choosing a date, time or both.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                            | Type                                                          | Read-Only | Shared |
|-----------------------------------------------------------------|---------------------------------------------------------------|-----------|--------|
| `AccessibilityHint<mobiledatetimepicker.accessibilityhint>`     | `String</api/data_types/string>`                              |           |        |
| `AccessibilityLabel<mobiledatetimepicker.accessibilitylabel>`   | `String</api/data_types/string>`                              |           |        |
| `AdjustTextSizeToFit<mobiledatetimepicker.adjusttextsizetofit>` | `Boolean</api/data_types/boolean>`                            |           |        |
| `BackgroundColor<mobiledatetimepicker.backgroundcolor>`         | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `BorderColor<mobiledatetimepicker.bordercolor>`                 | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `BorderWidth<mobiledatetimepicker.borderwidth>`                 | `Integer</api/data_types/integer>`                            |           |        |
| `CaptionColor<mobiledatetimepicker.captioncolor>`               | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `CaptionFont<mobiledatetimepicker.captionfont>`                 | `Font</api/graphics/font>`                                    |           |        |
| `ControlCount<mobiledatetimepicker.controlcount>`               | `Integer</api/data_types/integer>`                            | ✓         |        |
| `CornerSize<mobiledatetimepicker.cornersize>`                   | `Integer</api/data_types/integer>`                            |           |        |
| `DateCaption<mobiledatetimepicker.datecaption>`                 | `String</api/data_types/string>`                              |           |        |
| `DisplayMode<mobiledatetimepicker.displaymode>`                 | `DisplayModes<mobiledatetimepicker.displaymodes>`             |           |        |
| `DisplayStyle<mobiledatetimepicker.displaystyle>`               | `DisplayModes<mobiledatetimepicker.displaystyles>`            |           |        |
| `Enabled<mobiledatetimepicker.enabled>`                         | `Boolean</api/data_types/boolean>`                            |           |        |
| `Height<mobiledatetimepicker.height>`                           | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Icon<mobiledatetimepicker.icon>`                               | `Picture</api/graphics/picture>`                              |           |        |
| `Left<mobiledatetimepicker.left>`                               | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LockBottom<mobiledatetimepicker.lockbottom>`                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockLeft<mobiledatetimepicker.lockleft>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockRight<mobiledatetimepicker.lockright>`                     | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockTop<mobiledatetimepicker.locktop>`                         | `Boolean</api/data_types/boolean>`                            |           |        |
| `MaximumDate<mobiledatetimepicker.maximumdate>`                 | `DateTime</api/data_types/datetime>`                          |           |        |
| `MinimumDate<mobiledatetimepicker.minimumdate>`                 | `DateTime</api/data_types/datetime>`                          |           |        |
| `Name<mobiledatetimepicker.name>`                               | `String</api/data_types/string>`                              | ✓         |        |
| `Parent<mobiledatetimepicker.parent>`                           | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` | ✓         |        |
| `SelectedDate<mobiledatetimepicker.selecteddate>`               | `DateTime</api/data_types/datetime>`                          |           |        |
| `TimeCaption<mobiledatetimepicker.timecaption>`                 | `String</api/data_types/string>`                              |           |        |
| `Top<mobiledatetimepicker.top>`                                 | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Visible<mobiledatetimepicker.visible>`                         | `Boolean</api/data_types/boolean>`                            |           |        |
| `Width<mobiledatetimepicker.width>`                             | `Integer</api/data_types/integer>`                            | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

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

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                            | Parameters                                    | Returns |
|-------------------------------------------------|-----------------------------------------------|---------|
| `Closing<mobiledatetimepicker.closing>`         |                                               |         |
| `DateChanged<mobiledatetimepicker.datechanged>` | value As `DateTime</api/data_types/datetime>` |         |
| `Opening<mobiledatetimepicker.opening>`         |                                               |         |

## Enumerations

<div id="mobiledatetimepicker.displaymodes">

<div class="rst-class">

forsearch

</div>

</div>

MobileDateTimePicker.DisplayModes

### DisplayModes

> The types of data that will be displayed by the DateTimePicker.
>
> | Enum        |
> |-------------|
> | DateAndTime |
> | DateOnly    |
> | TimeOnly    |

<div id="mobiledatetimepicker.displaystyles">

<div class="rst-class">

forsearch

</div>

</div>

MobileDateTimePicker.DisplayStyles

DisplayStyles \*\*\*\*\*\*\*\*\*\*\*\*

> The various ways in which the user interface can be displayed by the DateTimePicker.
>
> | Enum    |
> |---------|
> | Wheels  |
> | Compact |
> | Inline  |

## Property descriptions

<div id="mobiledatetimepicker.accessibilityhint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.accessibilitylabel">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.adjusttextsizetofit">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.AdjustTextSizeToFit

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

> Automatically adjusts the text to the buttons's width when it's set to `True</api/language/true>`.

<div id="mobiledatetimepicker.backgroundcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.BackgroundColor

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

> The background color for the button.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> This code sets the value of the BackgroundColor property:
>
> ``` xojo
> DateTimePicker1.BackgroundColor = &c110034
> ```

<div id="mobiledatetimepicker.bordercolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.BorderColor

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

> The color of the edges of the button.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobiledatetimepicker.borderwidth">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.BorderWidth

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

> The thickness of the border, in points. The default is 0.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobiledatetimepicker.captioncolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.CaptionColor

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

> The `ColorGroup</api/graphics/colorgroup>` providing the color of the control's caption.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobiledatetimepicker.captionfont">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.CaptionFont

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

> The font of the control's caption.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobiledatetimepicker.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.ControlCount

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

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

<div id="mobiledatetimepicker.cornersize">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.CornerSize

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

> The size of the corner in points. Used to create rounded corners.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> This code sets the value of the BackgroundColor, CaptionColor, CornerSize and Icon properties:
>
> ``` xojo
> DateTimePicker1.BackgroundColor = Color.AccentThemeColor
> DateTimePicker1.CaptionColor = Color.White
> DateTimePicker1.CornerSize = 32
> DateTimePicker1.Icon = Picture.SystemImage("star", 24, Color.White)
> ```

<div id="mobiledatetimepicker.datecaption">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.DateCaption

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

> The button caption that appears when the `DisplayMode<mobiledatetimepicker.displaymode>` is set to DateOnly.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobiledatetimepicker.displaymode">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.DisplayMode

**DisplayMode** As `DisplayModes<mobiledatetimepicker.displaymodes>`

> Uses `DisplayModes<mobiledatetimepicker.displaymodes>` to specify what data the DateTimePicker can enter.
>
> Change the picker to show time only:
>
> ``` xojo
> StartTimePicker.DisplayMode = MobileDateTimePicker.DisplayModes.TimeOnly
> ```

<div id="mobiledatetimepicker.displaystyle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.DisplayStyle

**DisplayStyle** As `DisplayModes<mobiledatetimepicker.displaystyles>`

> Uses `DisplayStyles<mobiledatetimepicker.displaystyles>` to specify how the DateTimePicker should appear.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for Android.
>
> </div>
>
> Change the picker to compact:
>
> ``` xojo
> StartTimePicker.DisplayMode = MobileDateTimePicker.DisplayStyles.Compact
> ```

<div id="mobiledatetimepicker.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.height">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Height

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

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

<div id="mobiledatetimepicker.icon">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Icon

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

> Gets or sets an icon in front of the button's caption.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> This code sets the value of the BackgroundColor, CaptionColor, CornerSize and Icon properties:
>
> ``` xojo
> DateTimePicker1.BackgroundColor = Color.AccentThemeColor
> DateTimePicker1.CaptionColor = Color.White
> DateTimePicker1.CornerSize = 32
> DateTimePicker1.Icon = Picture.SystemImage("star", 24, Color.White)
> ```

<div id="mobiledatetimepicker.left">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Left

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

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

<div id="mobiledatetimepicker.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.maximumdate">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.MaximumDate

**MaximumDate** As `DateTime</api/data_types/datetime>`

> The maximum selectable date.
>
> Dates after the maximum date still appear, but cannot be selected.
>
> Set the maximum date to 50 years in the future:
>
> ``` xojo
> Var futureDate As DateTime
> Var interval As New DateInterval
> interval.Years = 50
> futureDate = DateTime.Now + interval
> StartDatePicker.MaximumDate = futureDate
> ```

<div id="mobiledatetimepicker.minimumdate">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.MinimumDate

**MinimumDate** As `DateTime</api/data_types/datetime>`

> The minimum selectable date.
>
> Dates before the minimum date still appear, but cannot be selected.
>
> Limit the minimum date to 100 years in the past:
>
> ``` xojo
> Var pastDate As DateTime
> Var interval As New DateInterval
> interval.Years = -100
> pastDate = DateTime.Now + interval
> StartDatePicker.MinimumDate = pastDate 
> ```

<div id="mobiledatetimepicker.name">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Name

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

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

<div id="mobiledatetimepicker.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.selecteddate">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.SelectedDate

**SelectedDate** As `DateTime</api/data_types/datetime>`

> The date that appears in the DateTimePicker.
>
> Gets the selected date from the date/time picker:
>
> ``` xojo
> Var theDate As DateTime
> theDate = StartDatePicker.SelectedDate
> ```

<div id="mobiledatetimepicker.timecaption">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.TimeCaption

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

> The button caption that appears when the `DisplayMode<mobiledatetimepicker.displaymode>` is set to TimeOnly.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobiledatetimepicker.top">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Top

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

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

<div id="mobiledatetimepicker.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Visible

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

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

<div id="mobiledatetimepicker.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Width

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

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

## Method descriptions

<div id="mobiledatetimepicker.addconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.addcontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.clearfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.ClearFocus

**ClearFocus**

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

<div id="mobiledatetimepicker.constraint">

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

</div>

<div class="rst-class">

forsearch

</div>

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

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.controls">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Handle

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

> The handle to the underlying native OS control.

<div id="mobiledatetimepicker.refresh">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.removeconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.removecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.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="mobiledatetimepicker.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.SetFocus

**SetFocus**

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

## Event descriptions

<div id="mobiledatetimepicker.closing">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.Closing

**Closing**

> Called when the control's layout is closing.

<div id="mobiledatetimepicker.datechanged">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileDateTimePicker.DateChanged

**DateChanged**(value As `DateTime</api/data_types/datetime>`)

> Called when the selection in the DateTimePicker is changed.
>
> Changing the `SelectedDate<mobiledatetimepicker.selecteddate>` property does **not** cause this event to be called.

<div id="mobiledatetimepicker.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

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

## Compatibility

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

<div class="seealso">

`MobileUIControl</api/user_interface/mobile/mobileuicontrol>` parent class; `DateTime</api/data_types/datetime>` class

</div>
