title: How to stop the first character in a text box from being '.'?
body: <p>This is the code I currently have:</p>
  
  <pre><code>private void textBox_KeyPress(object sender, KeyPressEventArgs e)
  {
      e.Handled = !char.IsDigit(e.KeyChar) &amp;&amp; !char.IsControl(e.KeyChar) &amp;&amp; e.KeyChar != '.';
      if (e.KeyChar == '.' &amp;&amp; (sender as TextBox).Text.IndexOf('.') &gt; -1) e.Handled = true; 
  
  }
  </code></pre>