Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyLeft Then '常数写错了 Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) KeyCode = 0' 对键码清0,才能取消对文本框起作用 End IfEnd Sub