Listbox HELP ?

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
13 posts Page 2 of 2
Contributors
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

Re: Listbox HELP ?
lesan101
mandai wrote:
What are you asking for exactly? Something to copy listbox items from one listbox to another?
okay the passwords are added to the list box on form2
i close form2
i close form1 (whitch is the adding form)
i open program again..
i go to form2
i see the passwords there saved :)

but how do i save theM>?
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Listbox HELP ?
mandai
In the form2 closing event you can try this:
Code: Select all
File.Delete("items.txt")
For i As Integer = 0 To ListBox1.Items.Count - 1
       File.AppendAllText("items.txt", ListBox1.Items(i) & vbCrLf)
Next
Then on the form2 load event use this:
Code: Select all
Dim lines As String() = File.ReadAllLines("items.txt")
For i As Integer = 0 To lines.Length - 1
       ListBox1.Items.Add(lines(i))
Next
User avatar
TerrorFoX
Just Registered
Just Registered
Posts: 5
Joined: Sun Aug 01, 2010 8:55 pm

Re: Listbox HELP ?
TerrorFoX
Oh, thx i needed this soo much!

Great Work.
13 posts Page 2 of 2
Return to “Tutorial Requests”