Input for WinForms | ComponentOne
In This Topic
    Data Formatting
    In This Topic

    Data Formatting in Input controls is controlled by the FormatType enumeration. Its enumerated values define data will be formatted in the control. Some of the options correspond to .NET standard format specifiers for numeric and date-time types, for example, StandardNumber and LongDate, see Formatting Types in the .NET Framework documentation.

    One FormatType option, CustomFormat, corresponds to the case of a custom format specifier as defined in the .NET Framework documentation, the specifier itself is determined by the CustomFormat property. For example, CustomFormat property is set to "##,###.###" produces numbers with at most five digits before and three digits after decimal point. See Custom Format Specifiers for details.

    There is also a special FormatType option, UseEvent, which delegates the formatting to the Formatting event.

    The ability to represent NULL values (System.DBNull) is controlled by the NullText and EmptyAsNull properties.

    Sometimes you may find it useful to trim leading and/or trailing spaces when showing the formatted value. You can use the TrimStart and TrimEnd properties for that.