-
Feb 29th, 2008, 02:08 AM
#1
Thread Starter
PowerPoster
copy selected listview to listbox
How can i copy all the selected items in a multiselect listview to a listbox
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
-
Feb 29th, 2008, 02:16 AM
#2
Re: copy selected listview to listbox
This seems to work, puts a comma between the items.
edit: fix
Code:
Dim x As Integer, y As Integer
Dim l$
For x = 1 To ListView1.ListItems.Count
If ListView1.ListItems.Item(x).Selected = True Then
l$ = l$ & ListView1.ListItems.Item(x).Text & ","
For y = 1 To ListView1.ListItems.Item(x).ListSubItems.Count
l$ = l$ & ListView1.ListItems.Item(x).SubItems(y) & ","
Next y
List1.AddItem Mid$(l$, 1, Len(l$) - 1) ' removes last comma
End If
l$ = ""
Next x
-
Feb 29th, 2008, 02:41 AM
#3
Thread Starter
PowerPoster
Re: copy selected listview to listbox
Originally Posted by Edgemeal
This seems to work, puts a comma between the items.
edit: fix
Code:
Dim x As Integer, y As Integer
Dim l$
For x = 1 To ListView1.ListItems.Count
If ListView1.ListItems.Item(x).Selected = True Then
l$ = l$ & ListView1.ListItems.Item(x).Text & ","
For y = 1 To ListView1.ListItems.Item(x).ListSubItems.Count
l$ = l$ & ListView1.ListItems.Item(x).SubItems(y) & ","
Next y
List1.AddItem Mid$(l$, 1, Len(l$) - 1) ' removes last comma
End If
l$ = ""
Next x
Thanks that works
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
-
Feb 29th, 2008, 03:06 AM
#4
Re: copy selected listview to listbox
l$ = l$ & ListView1.ListItems.Item(x).Text & ","
should just be,
l$ = ListView1.ListItems.Item(x).Text & ","
since theres nothing in L$ yet anyway.
-
Feb 29th, 2008, 07:24 AM
#5
Re: copy selected listview to listbox
Originally Posted by isnoend07
How can i copy all the selected items in a multiselect listview to a listbox
Why would you want to do this? If you have multiple columns, the ListView is the perfect control. A listbox does not have the column manipulation available in a Listview.
-
Feb 29th, 2008, 11:45 AM
#6
Thread Starter
PowerPoster
Re: copy selected listview to listbox
Originally Posted by Hack
Why would you want to do this? If you have multiple columns, the ListView is the perfect control. A listbox does not have the column manipulation available in a Listview.
Maybe you know a better way.
I send emails with attachments. The user can open his wab file in windows and fill a list view with icons. They can select items then clicking buttons fills 3 listboxs To, Cc and Bcc for email recipients. Like outlook does. Do you know a better way?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
-
Feb 29th, 2008, 12:23 PM
#7
Re: copy selected listview to listbox
Instead of 3 listboxs why one one additional ListView with three columns?
-
Feb 29th, 2008, 12:36 PM
#8
Thread Starter
PowerPoster
Re: copy selected listview to listbox
Originally Posted by Hack
Instead of 3 listboxs why one one additional ListView with three columns?
That would probably work for someone who is experienced at using a listview, but i got listboxs dialed in. As items may need to be removed
from the lisboxs(removeitem) and the transfered to the fields in the email program, seperated by (";") all this will be easy using listboxs. if fact i would not even use the listView if i could put icons into a listbox
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
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
|