-
Jun 11th, 2011, 08:57 AM
#1
Thread Starter
New Member
Copy data from listview and paste in another listview on a different form
Hi,
I'm writing a program in visual basic 6, when data is displayed in a listview.
I want to know, how can i copy that data and paste it in another listview on a different form.
thanks in advance,
cruzer
-
Jun 11th, 2011, 10:30 AM
#2
Re: Copy data from listview and paste in another listview on a different form
Form2 code to copy data from a listview on Form1. (Untested)
Code:
Dim itmX As ListItem
Set itmX = F2Listview.ListItems.Add(, , Form1.F1Listview.SelectedItem.Text)
itmX.SubItems(1) = Form1.F1Listview.SelectedItem.Subitems(1)
itmX.SubItems(2) = Form1.F1Listview.SelectedItem.Subitems(2)
-
Jun 12th, 2011, 12:15 AM
#3
Thread Starter
New Member
Re: Copy data from listview and paste in another listview on a different form
Hi,
will this copy everything in the listview or just certain things?
thanks,
cruzer
-
Jun 12th, 2011, 09:32 AM
#4
Fanatic Member
Re: Copy data from listview and paste in another listview on a different form
Code:
Dim intI As Integer
For intI = 1 To form1.ListView1.ListItems.Count
Set itmX = form2.listview2.ListItems.Add(, , form1.ListView1.ListItems(intI))
itmX.SubItems(2) = form1.ListView1.ListItems(intI).SubItems(2) ' Copy all Subitems(2)
Hi the above will copy all items, if you have more than one subitem just copy and paste the itmx.subitems(2) and change the 2 to a 3 for example e.t.c
-
Mar 23rd, 2014, 02:31 AM
#5
Registered User
Re: Copy data from listview and paste in another listview on a different form
hi there. im doing my project. saving data to textfile.
so what i wanted to ask is that how could i transfer the data from one datagrid to another datagrid in other form .
i have 1 datagrid in Form(Summaryofitempurchased)having 5 columns namely:Item,Price,Quantity,Day,Time . and another datagrid in Form(Receipt). i wanted the data Summaryofitempurchased transfer/copy to another datagrid IF AND only if the date today is equal to the date in the column of Summaryofitempurchased. how should i do that? please help? and the Receipt should save to textfile.
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
|