Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Retrieve Parts from Item in Arraylist

Retrieve Parts from Item in Arraylist

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dayekh
    wrote on last edited by
    #1

    Hi guys, In my windows form application, a user can store Items in a listbox. Each item is compiled from 4 textboxes. When the user clicks on another item, I need the contents of Item in the listbox to split and display in the textboxes. Currently I am trying to use an arraylist. However, it think i need more than just an arraylist. I hope you are able to help. Cheers.

    R 1 Reply Last reply
    0
    • D Dayekh

      Hi guys, In my windows form application, a user can store Items in a listbox. Each item is compiled from 4 textboxes. When the user clicks on another item, I need the contents of Item in the listbox to split and display in the textboxes. Currently I am trying to use an arraylist. However, it think i need more than just an arraylist. I hope you are able to help. Cheers.

      R Offline
      R Offline
      Reza Raad
      wrote on last edited by
      #2

      this can be good solution: you can specify new class that has 4 property for your 4 specifications now you can get collection of Array list based on your class define above, and at last you have an arryalist that have items corresponds with your special class. i think you can implement this yourself but for implement details post here again.

      Human knowlege belongs to the world

      D 1 Reply Last reply
      0
      • R Reza Raad

        this can be good solution: you can specify new class that has 4 property for your 4 specifications now you can get collection of Array list based on your class define above, and at last you have an arryalist that have items corresponds with your special class. i think you can implement this yourself but for implement details post here again.

        Human knowlege belongs to the world

        D Offline
        D Offline
        Dayekh
        wrote on last edited by
        #3

        Hi, Thank you so much for the reply. I have done as you said. I have a class file which has 4 private variables declared, and then I have 4 properties for each. The property code for each looks like this: Public Property Artist() As String Get Return strArtist End Get Set(ByVal Value As String) strArtist = Value End Set End Property These are the steps I have taken: In the Main form, OnButtonClick - Dim obj As New cls - obj.Variable1 = Me.Textbox1.Text - obj.Variable2 = Me.Textbox2.Text - obj.Variable3 = Me.Textbox3.Text - obj.Variable4 = Me.Textbox4.Text - arrList.Add(obj) ???? Is this correct? - Me.Listbox1.Items.Add(Textboxe1/2/3/4.Text) THEN, OnListBoxSelectIndexChanged - I need to retrieve the values from the arraylist which at this point holds the class instance - Then I need to put the data back into the original Textboxes. This is the part I am stuck at :( Thanks in advance :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups