• Welcome to Valhalla Legends Archive.
 

List View help....

Started by OuTLawZGoSu, December 22, 2003, 04:02 PM

Previous topic - Next topic

OuTLawZGoSu

Aight, I got 2 forms. on each one I got a listview. (Form1 got List1 and Form2 got List2) This is wat I need.

When I press a button on Form1, it loads Form2. When Form2 loads, everything in Form1.List1 goes to Form2.List2. When Form2.List2 is unloaded, everything in List2 goes to List1.

Help?

effect

#1
For I = 1 to Form1.Listview1.Listitems.Count
        Form2.Listview2.Listitems.Add I
Next I

Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

OuTLawZGoSu

Wtf?



Private Sub Form_Load()

For i = 1 To Form1.ChannelList.ListItems.Count
       Rechlist.ChannelList.ListItems.add i
Next i



It highlights " i " and sais, " Variable Not Defined "

If I type in " Dim i As String ", it highlights " i " and sais, " Type Missmatch "

Dono why it does this.

Help?

effect

#3
Dim I as Integer

Edit  * The code supplied MAY NOT be everything u need to accomplish your task but just an idea you can use to further implement what your looking to do.

Also seeing how u didnt know how to declare an integer im suggesting you go off and actually learn Visual Basic
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

OuTLawZGoSu

Quote from: NuLL on December 22, 2003, 04:32 PM
... actually learn Visual Basic

There is no way you can Learn Vb. There are about a billion parts of it.

Im open for suggestions.

effect

Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

CrAz3D

Quote from: OuTLawZGoSu on December 22, 2003, 04:45 PM
Quote from: NuLL on December 22, 2003, 04:32 PM
... actually learn Visual Basic

There is no way you can Learn Vb. There are about a billion parts of it.

Im open for suggestions.

You can't learn vb?...hmm, interesting theory.

rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

dxoigmn

#7
Quote from: OuTLawZGoSu on December 22, 2003, 04:45 PM
There is no way you can Learn Vb. There are about a billion parts of it.

So you've counted them all...interesting.  I'm sure if you have that much time on your hands you can learn the language as well.

OuTLawZGoSu

Aight, don't post if it ain't useful.

effect

Quote from: OuTLawZGoSu on December 22, 2003, 04:45 PM

there is no way you can Learn Vb. There are about a billion parts of it.

Im open for suggestions.


take some of your own advice
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

______

#10
Quote from: OuTLawZGoSu on December 22, 2003, 04:02 PM
Aight, I got 2 forms. on each one I got a listview. (Form1 got List1 and Form2 got List2) This is wat I need.

When I press a button on Form1, it loads Form2. When Form2 loads, everything in Form1.List1 goes to Form2.List2. When Form2.List2 is unloaded, everything in List2 goes to List1.

Help?

Hope this helps.



under
Public sub YourButton_click
   Dim i As Integer
   For i = 1 To List1.ListItems.Count
       Form2.List2.ListItems.Add , , List1.ListItems(i).Text
   Next i
   Form2.Show
end sub


'Form2 unload
Private Sub Form_Unload(Cancel As Integer)
   Dim i As Integer
   For i = 1 To List2.ListItems.Count
       Form1.List1.ListItems.Add , , List2.ListItems(i).Text
   Next i
End Sub


Edit: (Grok)  Added indentions.  If ListView is 0-based, you'll want to go For i = 0 to ListItems.Count - 1 as well.  I don't remember at the moment and haven't time to look it up.