1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ComboBox Question

Discussion in 'Visual Basic .NET' started by astradamasta, Feb 12, 2009.

  1. astradamasta

    astradamasta Registered Member

    Joined:
    Nov 24, 2008
    Messages:
    56
    Likes Received:
    8
    Hey, I am changing over from vb6 to .net In vb6 i used .ini files to save all my info, but im trying to get away from that. If i have a combo box full of items how can i get it to save all the items and load them in the combox box the next time the prog loads...thanks in advance
     
  2. ShadeDream

    ShadeDream Elite Member

    Joined:
    Nov 27, 2008
    Messages:
    2,215
    Likes Received:
    5,239
    Location:
    He who laughs last, laughs longest.
    This is nothing hard. Use Google and you will find your answer.
    You just have to create the list in the source code... if your good in VB then you should be able to figure this one out by using Google.
    Good Luck.

    Edit: nvm, I think I misunderstood your question, but big G should still be able to give you your answer, just use it.
     
    Last edited: Feb 16, 2009
  3. cyrix

    cyrix Junior Member

    Joined:
    Sep 19, 2008
    Messages:
    179
    Likes Received:
    61
    Occupation:
    Full Time Internet Marketer\Developer
    Location:
    United States
    doing it with code is a good idea for short lists, but for longer lists i would still use a file to hold the data. look into the system.io.filestream and system.io.streamreader and system.io.streamwriter for saving and loading files.

    to do it in code:
    Code:
    Dim Items() As String = {"item1", "item2", "item3", "item4"}
    For Each Item As String In Items
         ComboBox1.Items.Add(Item)
    Next
    
    Hit the thanks button if you found this usefull ;)
     
    • Thanks Thanks x 1