title: Detect decimal separator
body: <p>I have to detect decimal separator in current windows setting. Im using visual studio 2010, windows form. In particular, if DecimalSeparator is comma, if user input dot in textbox1,  I need show zero in textbox2.</p>
  
  <p>I tryed with this code, but not works:</p>
  
  <pre><code>private void tbxDaConvertire_KeyPress(object sender, KeyPressEventArgs e)
      {
          string uiSep = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;
          if (uiSep.Equals(","))
          {
              while (e.KeyChar == (char)46)
              {
                  tbxConvertito.Text = "0";
              }
          } 
      }
  </code></pre>
  
  <p>I have tryed also this code, but not work:</p>
  
  <pre><code>private void tbxDaConvertire_KeyPress(object sender, KeyPressEventArgs e)
      {
          string uiSep = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
          if (uiSep.Equals(","))
          {
              if (e.KeyChar == (char)46)
              {
                  tbxConvertito.Text = "0";
              }
          } 
      }
  </code></pre>