title: Limit Numbers after Decimal on Key Press Event
body: <p>I am using the following code to take only digits from user and only one decimal point , that is working fine for me on KeyPress Event :</p>
  
  <pre><code>if (!char.IsControl(e.KeyChar) &amp;&amp; !char.IsDigit(e.KeyChar) &amp;&amp; e.KeyChar != '.')
  {
      e.Handled = true;
  }
  
  if (e.KeyChar == '.' &amp;&amp; (sender as TextBox).Text.IndexOf('.') &gt; -1)
  {
      e.Handled = true;
  }
  </code></pre>
  
  <p>Now I want to Limit the numbers/Digits after the decimal/dot i.e 35.25468, means it take only 6 numbers/digits after the dot/decimal.</p>
  
  <p>Update me !</p>