'使用Ctrl+V粘贴,如果要使用鼠标右键粘贴的话就要用到子类化。
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim I As Long, K As Long, STR1 As String
If Shift = 2 And KeyCode = vbKeyV Then
STR1 = Clipboard.GetText
If Len(STR1) Then
I = Text1.SelStart
K = Text1.SelLength + I + 1
Text1.Text = Mid(Text1.Text, 1, I) & STR1 & Mid(Text1.Text, K, Len(Text1.Text))
End If
End If
End Sub