Core code:
'Only allowed to enter numbers, "." Private Sub txtField_KeyPress (ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtField0.KeyPress, txtField1.KeyPress, txtField2.KeyPress, txtField3.KeyPress If e. Keychar = "." THEN DIM TX AS TEXTBOX = CTYPE (Sender, TextBox) 'The last text box cannot be entered "." Is entered in other text boxes ".", Which is equivalent to entering the "tab" button, that is, the cursor A text box if tx.text = "" "or tx.selectedText <>" "" "" "" TXTFIELD3 "THENDKEYS.SEND (" {tab} ") Else 'final The text box cannot be entered. "E.handled = true endiff (not isnueric (e.keychar)) and E.KEYCHAR <> ControlChars.Back Then E.handled = true else Dim TX as textbox = ctype (Sender, Textbox) = 2 and E.Keychar <> controlchars.back and tx.selectedText.Length = 0) Then IF TX.NAME <> "txtfield3" THEN SendKeys.send ("{tab}") end if End if end if 'control controlChars.back 退 格 格 (sender, textbox) = 0 and E.KEYCHAR = Controlchars.back) THEN SELECT CASE TX1.NAME CASE "TXTFIELD3" if txtfield3.text = "" THEN TXTFIELD2.FOCUS () endiff2 "ife" txtfield2 "if txtfield2.text ="
THEN TXTFIELD1.FOCUS () end if case "TXTFIELD1" if txtfield1.text = "" "TXTFIELD0.FOCUS () end if End select end if End SUB When the error: When an error occurs: