How to copy selected listview items using clip board in VB.NET

M

Mamatha

Hi

I have some items in listview.
I want to copy the selected items from listview using the
clip board mechanism in VB.NET.
I used this code but it was not copied.

For Each lsvrow As ListViewItem In ListView1.SelectedItems
Clipboard.SetDataObject(lsvrow)
Next

What is the problem in this code,please give me the
solution.
How can i copy through VB.NET code.


Mamatha
 
H

Herfried K. Wagner [MVP]

Mamatha said:
I have some items in listview.
I want to copy the selected items from listview using the
clip board mechanism in VB.NET.
I used this code but it was not copied.

\\\
Dim s As String
///
For Each lsvrow As ListViewItem In ListView1.SelectedItems

\\\
s &= lsvrow.Text & ControlChars.NewLine
///

\\\
Clipboard.SetDataObject(s)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top