DateFormat Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Gets or sets the date's format. For a certain DateFormField the format string should be one of the strings returned through the SupportedDateFormats property. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date. When this property is an empty string, which is the default value, a default format is used depending on the culture set for the date field's text.
Syntax
public string DateFormat { get; set; }Public Property DateFormat As StringExamples
The following example adds a prefilled delivery-date field to a form by using DateFormField.DateFormat.
DateFormField dateFormField = new(DateTime.Today.AddDays(14), 0) { Name = "DeliveryDate" };
textControl.FormFields.Add(dateFormField);
dateFormField.DateFormat = "0.00";
if (!string.IsNullOrWhiteSpace(dateFormField.DateFormat))
{
Console.WriteLine($"Date Format: {dateFormField.DateFormat}");
}Dim dateFormField As New DateFormField(Date.Today.AddDays(14), 0) With { .Name = "DeliveryDate" }
textControl.FormFields.Add(dateFormField)
dateFormField.DateFormat = "0.00"
If Not String.IsNullOrWhiteSpace(dateFormField.DateFormat) Then
Console.WriteLine($"Date Format: {dateFormField.DateFormat}")
End If