vb中text问题

2025-02-22 10:55:39
推荐回答(1个)
回答1:

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 If
End Sub