如题所述
复制:
Private Sub Command1_Click()
Text1.SetFocus '到得焦点
Text1.SelLength = 0 '设置选定的起始位置
Text1.SelLength = Len(Text1.Text) '设置选定的长度
Clipboard.Clear '清除剪贴板上的内容
Clipboard.SetText Text1.SelText '复制选中的文本到剪贴板上
End Sub
粘贴:
Private Sub Command2_Click()
Text1.SelText = Clipboard.GetText()
End Sub
Private Sub Command1_Click()
Text1.SetFocus '到得焦点
Text1.SelLength = 0 '设置选定的起始位置
Text1.SelLength = Len(Text1.Text) '设置选定的长度
Clipboard.Clear '清除剪贴板上的内容
Clipboard.SetText Text1.SelText '复制选中的文本到剪贴板上
End Sub
粘贴:
Private Sub Command2_Click()
Text1.SelText = Clipboard.GetText()
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答 2009-02-15
Private Sub Command1_Click()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Clipboard.Clear
Clipboard.SetText Text1.Text
MsgBox "Copy OK"
End Sub
我是也VB新手,以后互相学习呗!!!
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Clipboard.Clear
Clipboard.SetText Text1.Text
MsgBox "Copy OK"
End Sub
我是也VB新手,以后互相学习呗!!!
第2个回答 2009-02-15
command1_clck()
a=text1.text
end sub
a这个变量是字符型就好
a=text1.text
end sub
a这个变量是字符型就好