TX Text Control .NET for Windows Forms

SupportedDateFormats Property

Property|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets an array of format picture strings which can be used to format the date. The returned format strings depend on the culture set for the date field's text. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date.

Syntax

public string[] SupportedDateFormats { get; }

Examples

The following example adds a prefilled delivery-date field to a form by using DateFormField.SupportedDateFormats.

DateFormField dateFormField = new(DateTime.Today.AddDays(14), 0) { Name = "DeliveryDate" };
textControl.FormFields.Add(dateFormField);

foreach (string text in dateFormField.SupportedDateFormats)
{
    Console.WriteLine(text.Length);
}