title: Proper Textbox that only allow numeric and decimal in visual basic
body: <p>I really need help in visual basic.</p>
  
  <p>I have 3 textboxes that allow numeric and decimal with the code below:</p>
  
  <pre><code>If Not Char.IsDigit(e.KeyChar) AndAlso Not Char.IsControl(e.KeyChar)
                                 AndAlso Not e.KeyChar = "." Then
      e.Handled = True
  End If
  </code></pre>
  
  <p>But I have encountered few problems:</p>
  
  <ol>
  <li>I can put "." anywhere</li>
  <li>when I try to add with each textbox, the result is a mess. example 1.2 + 3 =15 </li>
  </ol>
  
  <p>Can you fix my code so it can make a proper decimal calculation?</p>