新建From1(窗体),新建Text1(TextBox),Command1、Command2(按钮CommandButton),代码:
Private Sub Command1_Click()
'复制
If Text1.SelText <> "" Then Clipboard.SetText Text1.SelText
End Sub
Private Sub Command2_Click()
'剪切
If Text1.SelText <> "" Then Clipboard.SetText Text1.SelText: Text1.SelText = ""
End Sub
Private Sub Form_Load()
Text1.Text = "12345abc6789"
End Sub