Culture in WinUI MaskedTextBox
12 Jan 20231 minute to read
The MaskedTextBox 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.
|.||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).