title: Allow only a decimal point after an input of three digits in a textbox in VB.NET?
body: <p>How do I allow only a decimal point after an input of three digits in a textbox in VB.NET?</p>
  
  <p>Let's say I inputed "123" after that I can only put a decimal else it wont allow any other input. So the result would be "123."</p>
  
  <pre><code>    Dim KeyAscii As Integer
      KeyAscii = Asc(myE.KeyChar)
  
      Select Case KeyAscii
          Case Asc("0") To Asc("9"), Asc(ControlChars.Back)
  
              myE.Handled = False
          Case Asc(".")
  
              If InStr(myTextbox.Text, ".") = 0 Then
                  myE.Handled = False
              Else : myE.Handled = True
              End If
  
          Case myE.KeyChar = Chr(127)
              myE.Handled = False
          Case Else
              myE.Handled = True
      End Select
  </code></pre>