I want to copy the listbox content into a clipboard.
[code]Dim i as integer
Dim s as string
For i = 0 to Customerslist11.ListCount-1
s = s + EndOfLine + Customerslist11.cell(i,0)
if Customerslist11.Selected(i) then
//Copy to clipboard
Dim c as new Clipboard
c.SetText(s)
c.Close
end if
next[/code]
the result shows selected rows that I want to set into clipboard, but always starting from first row, even I tried to select started from row 3 to row 8.
so don’t copy the entire listbox, copy only what you want
Dim i as integer
Dim s as string
For i = 0 to Customerslist11.ListCount-1
if Customerslist11.Selected(i) then
s = s+ Customerslist11.cell(i,0) + EndOfLine
end if
next
//Copy to clipboard
Dim c as new Clipboard
c.SetText(s)
c.Close
[quote=397074:@Jean-Yves Pochez]Dim i as integer
Dim s as string
For i = 0 to Customerslist11.ListCount-1
if Customerslist11.Selected(i) then
s = s + EndOfLine + Customerslist11.cell(i,0)
end if
next
//Copy to clipboard
Dim c as new Clipboard
c.SetText(s)
c.Close
[/quote]
isn’t that what I just say???