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. List Box Selection

List Box Selection

Scheduled Pinned Locked Moved Visual Basic
question
6 Posts 4 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
    directred
    wrote on last edited by
    #1

    Hi, How do you select multi items in a listbox? I have a listbox with say the following values A, B, C, D, E, F I want to select and then display the items I selected e.g. C, E, F It has been a while since I done VB development and I am a wee bit rusty. Due to staff cutbacks. Thanks in advance.

    L L 2 Replies Last reply
    0
    • D directred

      Hi, How do you select multi items in a listbox? I have a listbox with say the following values A, B, C, D, E, F I want to select and then display the items I selected e.g. C, E, F It has been a while since I done VB development and I am a wee bit rusty. Due to staff cutbacks. Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      directred wrote:

      How do you select multi items in a listbox?

      There's an excellent example on MSDN[^] :)

      I are Troll :suss:

      D 1 Reply Last reply
      0
      • D directred

        Hi, How do you select multi items in a listbox? I have a listbox with say the following values A, B, C, D, E, F I want to select and then display the items I selected e.g. C, E, F It has been a while since I done VB development and I am a wee bit rusty. Due to staff cutbacks. Thanks in advance.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        the SelectionMode property needs your attention. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        1 Reply Last reply
        0
        • L Lost User

          directred wrote:

          How do you select multi items in a listbox?

          There's an excellent example on MSDN[^] :)

          I are Troll :suss:

          D Offline
          D Offline
          directred
          wrote on last edited by
          #4

          I have the multi selection on. What I want to display is the actual items selected to be used in another procedure e.g. if b then etc Almost like assigning the selected items to a variable. Hope this makes sense???

          D L 2 Replies Last reply
          0
          • D directred

            I have the multi selection on. What I want to display is the actual items selected to be used in another procedure e.g. if b then etc Almost like assigning the selected items to a variable. Hope this makes sense???

            D Offline
            D Offline
            Dr Walt Fair PE
            wrote on last edited by
            #5

            You need to loop through and examine whether each item is selected. See the following link for more info. http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.getselected%28v=VS.90%29.aspx[^]

            CQ de W5ALT

            Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

            1 Reply Last reply
            0
            • D directred

              I have the multi selection on. What I want to display is the actual items selected to be used in another procedure e.g. if b then etc Almost like assigning the selected items to a variable. Hope this makes sense???

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              By reading up on the members of the ListBox class, you're bound to find what you need. If I'm guessing right from what you wrote, it could be this[^]. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

              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