Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted

    [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...

    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
    Then on my form_load i have this code that doesn't work...

    Code:
    ListView1.Items.AddRange(My.Settings.dll)
    But i get the following error:

    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
    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

  2. #2
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Did you remember the namespaces?

    Code:
    Option Explicit On
    Imports System
    Imports System.Collections
    Imports System.Collections.Specialized


     


     


     



    The Most complete application MPGH will ever offer - 68%




  3. #3
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Yup have them all...

  4. #4
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310
    try making that a string
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  5. #5
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Quote Originally Posted by guza44_44 View Post
    try making that a string
    do you mean make the

    ListView1.Items.AddRange(My.Settings.dll)

    to:

    ListView1.Items.AddRange(My.Settings.dll.string)


    because then i get:
    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 'String' cannot be converted to 'System.Windows.Forms.ListView.ListViewItemCollection'.
        'Public Sub AddRange(items() As System.Windows.Forms.ListViewItem)': Value of type 'String' 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	84	9	System Watch - Breach - Encyption 2.0

  6. #6
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310
    no like
    Code:
    Dim thingy as string
    thing = my.settings.dll
    
    ListView1.Items.AddRange(thingy)
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  7. #7
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    thingy = Hilarious


     


     


     



    The Most complete application MPGH will ever offer - 68%




  8. #8
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Quote Originally Posted by guza44_44 View Post
    no like
    Code:
    Dim thingy as string
    thing = my.settings.dll
    
    ListView1.Items.AddRange(thingy)

    But its an array of strings... So there is more than one string or phrase inside the setting... and addrange is adding a range, for just one string you would do "ListView1.Items.Add('thingy')"

  9. #9
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    String wont help, Give me a few minutes, Im playing around to see what i can do


     


     


     



    The Most complete application MPGH will ever offer - 68%




  10. #10
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Quote Originally Posted by NextGen1 View Post
    String wont help, Give me a few minutes, Im playing around to see what i can do
    Ok thanks alot

  11. #11
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Not a problem , Just bare with me (i gave myself a ten minute deadline)


     


     


     



    The Most complete application MPGH will ever offer - 68%




  12. #12
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Yeh i have had this question ever since i started VB... thought i would post it here to try and find an answer.

    I guess im not as big of a VB noob as i said i was..

  13. #13
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    I am adding a breakpoint to see If I can debug this


     


     


     



    The Most complete application MPGH will ever offer - 68%




  14. #14
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Alright i have to go in like 10 mins because i have to get all my stuff ready for snowboarding.. If i don't get it figured out tonight ill try tomorrow

  15. #15
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    The listbox "stores" object references as the items rather than strings. It
    will then return the object when you click or change the listbox selected
    item.

    I'll see what I can do tonight


     


     


     



    The Most complete application MPGH will ever offer - 68%




Page 1 of 2 12 LastLast

Similar Threads

  1. String Question
    By wraithkilla in forum Combat Arms Coding Help & Discussion
    Replies: 1
    Last Post: 08-22-2011, 03:15 PM
  2. [Tutorial] String collections and settings. I think so.
    By Jason in forum Visual Basic Programming
    Replies: 18
    Last Post: 09-14-2010, 09:47 PM
  3. [SOLVED][Question]External BoxEsp V4.32 Sniper Aimbot + Strings Esp Aimbot Question.
    By bryn1000 in forum Call of Duty Modern Warfare 2 Help
    Replies: 11
    Last Post: 07-05-2010, 05:12 PM
  4. Photoshop Question
    By arunforce in forum Art & Graphic Design
    Replies: 6
    Last Post: 01-15-2006, 11:38 AM
  5. question
    By wardo1926 in forum WarRock - International Hacks
    Replies: 0
    Last Post: 12-30-2005, 07:36 PM