Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox items copy 1

Status
Not open for further replies.

554

Technical User
Dec 14, 2005
7
0
0
ZA
Hi!

I have a list box, I want to be able to, when the items are selected, click the right button on the mouse and be given the option to copy the items and then be able to paste them onto a word document or wordpad or so, how would I go about doing this?

CJ
 
Try this:

Dim s As String = String.Empty
For Each li As String In ListBox1.SelectedItems
s &= li & Environment.NewLine
Next
Clipboard.SetDataObject(s)



Hope this is it
 
Forgot to say that: Set the listbox1 SelectionMode to e.g MultiSimple (or MultiExtended).
Not one or none.
 
have you considerd enabling drag and drop?


if it is to be it's up to me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top