在VB制作剪贴板

发布网友 发布时间:2022-04-22 08:31

我来回答

2个回答

热心网友 时间:2022-06-18 16:36

Private Sub 复制_Click()
If Text1.SelText <> "" Then
Clipboard.SetText Text1.SelText
End If
End Sub

Private Sub 剪切_Click()
If Text1.SelText <> "" Then
Clipboard.SetText Text1.SelText
Text1.SelText = ""
End If
End Sub

Private Sub 粘贴_Click()
Text1.SetFocus
If Trim(Clipboard.GetText) <> "" Then
If Text1.SelStart = 0 Then
Text1.Text = Clipboard.GetText & Text1.Text
ElseIf Text1.SelStart = Len(Text1.Text) Then
Text1.Text = Text1.Text & Clipboard.GetText
Else
Text1.Text = Left(Text1.Text, Text1.SelStart) & Clipboard.GetText & Right(Text1.Text, Len(Text1.Text) - Text1.SelStart)
End If
End If
End Sub

热心网友 时间:2022-06-18 16:37

Private Sub Command1_Click()
If Text1.Text <> "" Then
Clipboard.SetText Text1.Text
Text1.Text = ""
End If
End Sub

Private Sub Command2_Click()
If Text1.Text <> "" Then
Clipboard.SetText Text1.Text
End If
End Sub

Private Sub Command3_Click()
Text1.SetFocus
If Trim(Clipboard.GetText) <> "" Then
If Text1.SelStart = 0 Then
Text1.Text = Clipboard.GetText & Text1.Text
ElseIf Text1.SelStart = Len(Text1.Text) Then
Text1.Text = Text1.Text & Clipboard.GetText
Else
Text1.Text = Left(Text1.Text, Text1.SelStart) & Clipboard.GetText & Right(Text1.Text, Len(Text1.Text) - Text1.SelStart)
End If
End If
End Sub

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com