I am hoping this is not inappropriate to do on here if it is I apologize in advance and will let the thread die a slow agonizing death.
Here goes:
I have a little TextBox app that's supposed to only allow numeric’s positive and negative and allow 2 decimal places. I have tested it and it seems to work as intended. What I'd like is for you all to try and break it. The max characters functionality needs some work but it's not the focus of my TextBox.
'K. W. 4/19/2012
'TextBox Control For
'Numerics/Money entry
'1 Decimal Point
'2 Decimal Places
'Allows The BackSpace
'Handles enter key by Moving to the Next control
'Set Max characters checked - this sets it to 4 if not checked allows 10 characters
'The button just multiplies the textbox value by 5
Public Class Form1
Private maxSize As Boolean = False
Private numMaxSize As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If T1.Text <> "" Then
If CDbl(T1.Text) > 0 Or CDbl(T1.Text) < 0 Then
MsgBox(CDbl(T1.Text) * 5)
T1.Clear()
End If
End If
GetNextControl(Button1, False).Focus()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Add Handler for all the Numeric only TextBoxes on the Form
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is TextBox Then
AddHandler ctrl.KeyPress, AddressOf Boxkeypress
End If
Next ctrl
T1.MaxLength = 10
End Sub
Private Sub Boxkeypress(ByVal sender …