1个回答
展开全部
需添加List列表框,代码如下:
Private Sub Form_Load()
'对列表框进行初始化
List1.Clear
List1.AddItem "资料1"
List1.AddItem "资料2"
List1.AddItem "资料3"
List1.ToolTipText = "请单击右键复制"
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Clipboard.Clear
Select Case List1.ListIndex
Case 0
Clipboard.SetText List1.List(List1.ListIndex)
Case 1
Clipboard.SetText List1.List(List1.ListIndex)
Case 2
Clipboard.SetText List1.List(List1.ListIndex)
End Select
MsgBox "文本[" & List1.List(List1.ListIndex) & "]成功复制到剪切板!" & "请在别处粘贴试验!"
End Sub
Private Sub Form_Load()
'对列表框进行初始化
List1.Clear
List1.AddItem "资料1"
List1.AddItem "资料2"
List1.AddItem "资料3"
List1.ToolTipText = "请单击右键复制"
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Clipboard.Clear
Select Case List1.ListIndex
Case 0
Clipboard.SetText List1.List(List1.ListIndex)
Case 1
Clipboard.SetText List1.List(List1.ListIndex)
Case 2
Clipboard.SetText List1.List(List1.ListIndex)
End Select
MsgBox "文本[" & List1.List(List1.ListIndex) & "]成功复制到剪切板!" & "请在别处粘贴试验!"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询