[Question] String Collections
Hey so i am trying to make a VB app that saves all of the items in my listview1 (Set to details, if it matters) to the settings. So i go into settings and make one named "dll" and it is set to "System.Collections.Specialized.StringCollecti ons" and has no value. Then i have the following function to save the listview1.items to the setting...
Then on my form_load i have this code that doesn't work...
But i get the following error:
I have not idea how to take the array from the setting, and put it into my listview... if you have any ideas or codes please let me know...
Yeh im not the best in VB so i might ask you to explain :P
thanks Helicopter12
Code:
Private Function call_save() As Integer
Dim myCol As New StringCollection()
For Each lsvrow As ListViewItem In ListView1.Items
myCol.Add(lsvrow.Text)
Next
My.Settings.dll = myCol
My.Settings.Save()
End Function
Code:
ListView1.Items.AddRange(My.Settings.dll)
Code:
Error 1 Overload resolution failed because no accessible 'AddRange' can be called with these arguments:
'Public Sub AddRange(items As System.Windows.Forms.ListView.ListViewItemCollection)': Value of type 'System.Collections.Specialized.StringCollection' cannot be converted to 'System.Windows.Forms.ListView.ListViewItemCollection'.
'Public Sub AddRange(items() As System.Windows.Forms.ListViewItem)': Value of type 'System.Collections.Specialized.StringCollection' cannot be converted to '1-dimensional array of System.Windows.Forms.ListViewItem'. C:\Users\****\Desktop\Everything\VC++\Advanced Injector\System Watch - Breach - Encyption 2.0\Form1.vb 83 9 System Watch - Breach - Encyption 2.0
Yeh im not the best in VB so i might ask you to explain :P
thanks Helicopter12
