Culture in WinUI Masked TextBox

19 Dec 20231 minute to read

The Masked TextBox allows you to set any Culture support for currency symbols, date separators, time separators, group separators, and decimal separators by using the below special symbols.

Characters Description
. Decimal separator determined by current culture.
, Group separator determined by current culture.
/ Date separator determined by current culture.
: Time separator determined by current culture.
$ Currency symbol determined by current culture.

The following example shows how to set the the France culture for currency symbol, group separator and decimal separator.

SfMaskedTextBox maskedTextBox = new SfMaskedTextBox();
maskedTextBox.Width = "200";
maskedTextBox.MaskType = MaskedTextBoxMaskType.Simple;
maskedTextBox.Mask = "$ 0,000.00";
maskedTextBox.Culture = new CultureInfo("fr-FR");

Based on the France Culture, the ‘$’ will be localized to ‘€’; ‘.’ will be localized to ‘,’ and ‘,’ will be localized to ‘ ‘(single white space).

WinUI Masked TextBox culture