title: Decimals where they shouldn't be
body: <p>I nabbed a bit of code that prevents the user from entering non-numbers into a textbox, and monkeyed with it for a bit, trying to get it to include an exception for a decimal point. It didn't work, so I figured I'd just put the code back the way it was when I found it, because I don't yet know how to fix things if I break them.</p>
  
  <p>Weird thing is, as soon as i put the code back to normal it suddenly started <em>doing the thing I originally wanted it to</em>, namely allowing the user to type a decimal into the textbox. This would be righteously excellent, if I could understand why in the name of Shiva my tiny program is doing something that it isn't programmed to do.</p>
  
  <p>Have I somehow given birth to true AI and started the singularity? </p>
  
  <p>EDIT (for clarity): </p>
  
  <ul>
  <li>I am a total beginner. </li>
  <li>I found this code that only allows numbers,
  backspace, and delete to be added to a textbox.  </li>
  <li>I altered it, making assumptions about what it was doing, so that it would also allow a decimal point.  </li>
  <li>This didn't work.  </li>
  <li>I returned the code to how I found it. </li>
  <li>Only after this point did it start allowing the decimal point. </li>
  <li>This doesn't make sense, because it is now doing something that isn't in the code. </li>
  <li>Does the same thing happen to you when you put the code into Visual Studio?</li>
  <li>If so, why might this be happening?</li>
  <li><p>Is the world going to end because my computer is interpreting my desires and performing them in spite of all of the rules of space, time, and logic?</p>
  
  <pre><code>Public Class Form1
      Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
  
          If Not Char.IsNumber(e.KeyChar) And Not e.KeyChar = Chr(Keys.Back) And Not e.KeyChar = Chr(Keys.Delete) Then
  
              e.Handled = True
              MessageBox.Show("numbers only", "baleted")
  
          End If
  
      End Sub
  End Class
  </code></pre></li>
  </ul>