发布网友 发布时间:2022-05-21 00:26
共3个回答
热心网友 时间:2023-10-09 16:11
Private tempTxt As String
Private Sub Command1_Click()
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
tempTxt = tempTxt + Text1.SelText
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
tempTxt = tempTxt + Text2.SelText
Text3.SetFocus
Text3.SelStart = 0
Text3.SelLength = Len(Text3.Text)
tempTxt = tempTxt + Text3.SelText
End Sub
Private Sub Command2_Click()
Clipboard.Clear
Clipboard.SetText tempTxt
'Text4.SetFocus
'Text4.Text = Clipboard.GetText
End Sub
-------------------------------------------------------------------
可以把需要拷贝文本的文本框定义成控件数组
(将文本框控件的名称设为相同,系统会提示是否创建控件数组,选择确定)
Private tempTxt As String
Private Sub Command1_Click()
For i = Text1.LBound To Text1.UBound
Text1(i).SetFocus
Text1(i).SelStart = 0
Text1(i).SelLength = Len(Text1(i).Text)
tempTxt = tempTxt + Text1(i).SelText
Next
End Sub
Private Sub Command2_Click()
Clipboard.Clear
Clipboard.SetText tempTxt
'Text4.SetFocus
'Text4.Text = Clipboard.GetText
End Sub
来自:求助得到的回答热心网友 时间:2023-10-09 16:11
编辑一个文本框,然后选择它,按CTRL + X剪切下来,然后在“视图”菜单下,选择“页眉和页脚命令,按CTRL + V粘贴,关闭页眉和页脚命令即可热心网友 时间:2023-10-09 16:12
当选择鼠标不成立,否则,只要有一点点的阻力被复制。