<p>I'm trying to see if the user has pressed a decimal separator in a text box, and either allow or suppress it depending on other parameters.</p>

<p>The NumberdecimalSeparator returns as 46, or '.' on my US system. Many other countries use ',' as the separator. The KeyDown event sets the KeyValue to 190 when I press the period.</p>

<p>Do I just continue to look for commas/periods, or is there a better way?</p>

The call
```
```
CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator
```
```
gets the decimal separator for the current user interface culture. You can use other cultures to get the separator for other languages.
EDIT
From the 166 cultures that are reported in my system (
```
CultureInfo.GetCultures(CultureTypes.SpecificCultures).Count()
```
), it seems that only two separators are used: period and comma. You can try this in your system:
```
```
var seps = CultureInfo.GetCultures(CultureTypes.SpecificCultures)
            .Select(ci => ci.NumberFormat.NumberDecimalSeparator)
            .Distinct()
            .ToList();
```
```
Assuming that this is true, this method may be helpful (note that the
```
keyCode
```
is OR'ed with the
```
modifiers
```
flag in order to eliminate invalid combinations):
```
```
private bool IsDecimalSeparator(Keys keyCode, Keys modifiers)
    {
        Keys fullKeyCode = keyCode | modifiers;
        if (fullKeyCode.Equals(Keys.Decimal))          // value=110
            return true;

        string uiSep = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;
        if (uiSep.Equals("."))
            return fullKeyCode.Equals(Keys.OemPeriod); // value=190
        else if (uiSep.Equals(","))
            return fullKeyCode.Equals(Keys.Oemcomma);  // value=188
        throw new ApplicationException(string.Format("Unknown separator found {0}", uiSep));
    }
```
```
A last note: According to
Keys enumeration
, the value 46 that you mention corresponds to the DEL (Delete) key (i.e. the point when Num Lock is OFF).