简单的可以直接 Text.Locked = True,但是不能限制右键的粘贴。
如果要连右键粘贴也限制的可试试这样
Dim Str As String
Private Sub Command1_Click()
Str = "123"
Text.Text = Str
End Sub
Private Sub Form_Load()
Str = "abc"
Text.Text = Str
End Sub
Private Sub Text_Change()
Text.Text = Str
End Sub
Dim s As String
Private Sub Form_Load()
s = Text1.Text
End Sub
Private Sub Text1_Change()
Text1.Text = s
Text1.SelStart = Len(Text1.Text)
End Sub