DateEdit.MinTime Property
Gets or sets the editor’s minimum time. This property is in effect only if the editor operates TimeOnly data. This is a dependency property.
Namespace: DevExpress.Xpf.Editors
Assembly: DevExpress.Xpf.Core.v24.2.dll
NuGet Package: DevExpress.Wpf.Core
Declaration
Property Value
Type | Description |
---|---|
Nullable<TimeOnly> | Specifies the minimum allowed time. If null, the TimeOnly.MinValue is used. |
Remarks
A user can change the time by typing it in the text box. In this instance, if a new value exceeds the minimum allowed time, an error icon is displayed, indicating that the specified value is not valid.
A user cannot select time from the drop-down time picker if it is earlier than the minimum allowed time.
To specify the maximum allowed time, use the DateEdit.MaxTime property.
For more information about DateOnly and TimeOnly support in the DateEdit control, refer to the following section: Interact with DateOnly and TimeOnly Data.
Example: Use Spin Buttons to Edit a TimeOnly Value
The following code snippet allows users to press spin buttons to increase or decrease a TimeOnly value:
<dxe:DateEdit MaskType="TimeOnly" AllowDefaultButton="False"
PopupOpening="DateEdit_PopupOpening"
DefaultTime="10:30" MinTime="7:30">
<dxe:ButtonEdit.Buttons>
<dxe:SpinButtonInfo SpinDownClick="SpinButtonInfo_SpinDownClick"
SpinUpClick="SpinButtonInfo_SpinUpClick"/>
</dxe:ButtonEdit.Buttons>
</dxe:DateEdit>
void SpinButtonInfo_SpinDownClick(object sender, RoutedEventArgs e) {
((ButtonEdit)BaseEdit.GetOwnerEdit((SpinButton)sender)).SpinDown();
}
void SpinButtonInfo_SpinUpClick(object sender, RoutedEventArgs e) {
((ButtonEdit)BaseEdit.GetOwnerEdit((SpinButton)sender)).SpinUp();
}
private void DateEdit_PopupOpening(object sender, OpenPopupEventArgs e) {
e.Cancel = true;
}