title: TextBox.Text accept decimal inputs only
body: <p>How to make <code>txtamount.text</code> accept only decimal values,it should accept only one <code>.</code> not more than one.</p>
  
  <p>My following is my try but it accept more <code>.</code></p>
  
  <pre><code>Private Sub txtamount_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtamount.KeyPress
          If Asc(e.KeyChar) &lt;&gt; 8 Then
              If (Asc(e.KeyChar) &lt; 48 Or Asc(e.KeyChar) &gt; 57) And Asc(e.KeyChar) &lt;&gt; 46 Then
                  e.Handled = True
              End If
          End If
      End Sub
  </code></pre>