Question copy selected items in listbox

andrews

Well-known member
Joined
Nov 22, 2011
Messages
132
Programming Experience
5-10
I selected several items in a lisbox.
How to copy?
It seems that Ctrl C is not possible.
 
You can access the selected items in a ListBox via the SelectedItems property. What do you want to do with the data? If your purpose is to make the data available for pasting elsewhere then you can use the Clipboard class to actually copy the data to the Windows Clipboard. If you just want to put it somewhere in your app then go ahead and put it there. If you want to make it appear to the user as though standard Windows Clipboard functionality is being used then you can handle the KeyDown event and test for Ctrl+C and then copy the data to the Clipboard.
 
Thanks, I want to have the selected items in the clipboard (Ctrl +c?) for using outside the program and to paste elsewhere.
But how to program to make Ctrl+c available?
 
As I said, handle the KeyDown event of the ListBox, detect the key combination, get the SelectedItems and copy them using the Clipboard. Now that you know the steps, it's time to break out your search skills and research them.
 
Back
Top