|
-
Jul 6th, 2000, 06:46 AM
#1
Thread Starter
New Member
Hi dudes,
i have a listbox with many entrys and i want to copy these manualy into my clipboard. but i can´t use strg+c or rightclick -> copy. any ideas how i can fix it?
thx alot,
bimsel
-
Jul 6th, 2000, 07:55 AM
#2
Lively Member
You cannot do it with listbox. Try to use a combobox instead and set its style to DropDown Combo
-
Jul 6th, 2000, 10:06 AM
#3
This will allow you to use ctrl-c to copy the selected listbox to the clipboard.
Code:
Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim ShiftTest As Integer
ShiftTest = Shift And 7
If ShiftTest = 2 Then
If KeyCode = vbKeyC Then
Clipboard.SetText List1.List(List1.ListIndex)
End If
End If
End Sub
-
Jul 6th, 2000, 10:15 AM
#4
Instead of List1.List(List1.ListIndex), you could use List1.Text that gets the text of the selected item.
-
Jul 6th, 2000, 11:11 AM
#5
If you want use a menu, use this method. First, make a Menu called mnuEdit and make a sub menu called mnuCopy. Set the Visible property for mnuEdit to False.
Code:
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
If List1.Text <> "" Then PopupMenu mnuEdit
End If
End Sub
Private Sub mnuCopy_Click()
Clipboard.SetText List1.List(List1.ListIndex)
End Sub
-
Jul 6th, 2000, 04:57 PM
#6
When copying to a listbox, it copies the number and then copies another one. So the past number is deleted and replaced with a new one.
Here is what you do:
Code:
Needed: Textbox, Listbox
For i = 0 To list1.ListCount - 1
text1.Text = text1.Text & i & " " 'Chr$(13) + Chr$(10) can be used to skip a line.
Next i
Clipboard.SetText text1
-
Jul 7th, 2000, 05:02 AM
#7
Thread Starter
New Member
Thanks,
Its working now
Bimsel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|