[Root] / Xceed.Wpf.Controls Assembly / Xceed.Wpf.Controls Namespace / DateTimeTextBox Class / CustomFormatSpecifier Property


In This Topic
    CustomFormatSpecifier Property (DateTimeTextBox)
    In This Topic
    Gets or sets the custom format specifier that will be used to mask the inputted text.
    Syntax
    'Declaration
     
    Public Property CustomFormatSpecifier As String
    'Usage
     
    Dim instance As DateTimeTextBox
    Dim value As String
     
    instance.CustomFormatSpecifier = value
     
    value = instance.CustomFormatSpecifier
    public string CustomFormatSpecifier {get; set;}

    Property Value

    A string representing the custom format specifier that will be used to mask the inputted text. By default, a null reference (Nothing in Visual Basic).

    Remarks

    The custom format specifier will only be used if the DateTimeMaskMode property is set to DateTimeMaskMode.Custom.

    The CustomFormatSpecifier only allows a subset of the rules found here:
    https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings.

    Here are the specific constraints:

    • the following specifiers are not allowed (streak length does not matter): 'f', 'F', 'g', 'G', 'K', 'z', '%'
    • the following specifiers are allowed, but the streak length cannot exceed 2: 'd', 'h', 'H', 'M', 'm', 's'
    • the following specifier is allowed, but the streak lenght must be 1, 2 or 4: 'y'
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also