Back to Devexpress

RepositoryItemTimeSpanEdit.EditMask Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtimespanedit-1015b689.md

latest3.5 KB
Original Source

RepositoryItemTimeSpanEdit.EditMask Property

Gets or sets the TimeSpan mask expression used in the editor.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Format")]
public override string EditMask { get; set; }
vb
<DXCategory("Format")>
Public Overrides Property EditMask As String

Property Value

TypeDescription
String

The TimeSpan mask expression used in the editor.

|

Remarks

The editor allows users to edit days, hours, minutes, seconds, and milliseconds in the edit box or drop-down menu.

Value format depends on the current culture settings (see LongTimePattern). Use the MaskSettings or EditMask property to customize the input mask. The editor supports mask specifiers for days (‘d’), hours (‘h’), minutes (‘m’), seconds (‘s’), and second fractions (‘f’). Drop-down menu sections correspond to the specified mask (if the input mask contains only days, the drop-down menu allows the user to change only days).

Note

The mask expression should be compatible with the TimeSpan format.

csharp
timeSpanEdit1.Properties.EditMask = "dd.hh.mm";
//Or
//using DevExpress.XtraEditors.Mask;
//var mask = timeSpanEdit1.Properties.MaskSettings.Configure<MaskSettings.TimeSpan>();
//mask.MaskExpression = "dd.hh.mm";
vb
timeSpanEdit1.Properties.EditMask = "dd.hh.mm"
'Or
'using DevExpress.XtraEditors.Mask;
'var mask = timeSpanEdit1.Properties.MaskSettings.Configure<MaskSettings.TimeSpan>();
'mask.MaskExpression = "dd.hh.mm";

You can use MinValue and MaxValue properties to specify the range of possible values. The drop-down menu does not display values outside the range.

csharp
timeSpanEdit1.Properties.MinValue = new TimeSpan(0, 1, 0, 0);
timeSpanEdit1.Properties.MaxValue = new TimeSpan(2, 2, 5, 59);
vb
timeSpanEdit1.Properties.MinValue = New TimeSpan(0, 1, 0, 0)
timeSpanEdit1.Properties.MaxValue = New TimeSpan(2, 2, 5, 59)

See Also

RepositoryItemTimeSpanEdit Class

RepositoryItemTimeSpanEdit Members

DevExpress.XtraEditors.Repository Namespace