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. C / C++ / MFC
  3. Select more than one item in a listbox

Select more than one item in a listbox

Scheduled Pinned Locked Moved C / C++ / MFC
4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have a dialog based app with three listboxes. I used AddString("") to add several items to each string. When I run the program, it allows me to select all the items at one time. I want the user to only be able to select one item at a time. How do I do this? Thanks, Stephanie

    A 1 Reply Last reply
    0
    • L Lost User

      I have a dialog based app with three listboxes. I used AddString("") to add several items to each string. When I run the program, it allows me to select all the items at one time. I want the user to only be able to select one item at a time. How do I do this? Thanks, Stephanie

      A Offline
      A Offline
      Andrei Zenkovitch
      wrote on last edited by
      #2

      Hi, If you create list boxes explicitely using create function then make sure that you didn't specify LBS_EXTENDEDSEL or LBS_MULTIPLESEL style. If you use dialog editor for creating the template for your dialog then you have to display a property dialog for the list box control. On this dialog you have to select the second page "Styles" and in the "Selection" combo box you have to choose "Single" item Regards, Andrei Zenkovitch Dundas Software ================== The original message was: I have a dialog based app with three listboxes. I used AddString("") to add several items to
      each string. When I run the program, it allows me to select all the items at one time. I
      want the user to only be able to select one item at a time. How do I do this?

      Thanks,
      Stephanie

      L 1 Reply Last reply
      0
      • A Andrei Zenkovitch

        Hi, If you create list boxes explicitely using create function then make sure that you didn't specify LBS_EXTENDEDSEL or LBS_MULTIPLESEL style. If you use dialog editor for creating the template for your dialog then you have to display a property dialog for the list box control. On this dialog you have to select the second page "Styles" and in the "Selection" combo box you have to choose "Single" item Regards, Andrei Zenkovitch Dundas Software ================== The original message was: I have a dialog based app with three listboxes. I used AddString("") to add several items to
        each string. When I run the program, it allows me to select all the items at one time. I
        want the user to only be able to select one item at a time. How do I do this?

        Thanks,
        Stephanie

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

        I had "Single" selected. It makes the list box gray (instead of white) and won't unselect item. ie. The default selection is String1. If you click on String2, both are blue. If you click again on String1, it stays blue. It's impossible to select only one string, unless you take the default. I'm not sure what's going on. Stephanie ================== The original message was: Hi,

        If you create list boxes explicitely using create function then make sure that you didn't specify LBS_EXTENDEDSEL or LBS_MULTIPLESEL style.
        If you use dialog editor for creating the template for your dialog then you have to display a property dialog for the list box control. On this dialog you have to select the second page "Styles" and in the "Selection" combo box you have to choose "Single" item

        Regards,
        Andrei Zenkovitch
        Dundas Software
        ==================
        The original message was:

        I have a dialog based app with three listboxes. I used AddString("") to add several items to
        each string. When I run the program, it allows me to select all the items at one time. I
        want the user to only be able to select one item at a time. How do I do this?

        Thanks,
        Stephanie

        L 1 Reply Last reply
        0
        • L Lost User

          I had "Single" selected. It makes the list box gray (instead of white) and won't unselect item. ie. The default selection is String1. If you click on String2, both are blue. If you click again on String1, it stays blue. It's impossible to select only one string, unless you take the default. I'm not sure what's going on. Stephanie ================== The original message was: Hi,

          If you create list boxes explicitely using create function then make sure that you didn't specify LBS_EXTENDEDSEL or LBS_MULTIPLESEL style.
          If you use dialog editor for creating the template for your dialog then you have to display a property dialog for the list box control. On this dialog you have to select the second page "Styles" and in the "Selection" combo box you have to choose "Single" item

          Regards,
          Andrei Zenkovitch
          Dundas Software
          ==================
          The original message was:

          I have a dialog based app with three listboxes. I used AddString("") to add several items to
          each string. When I run the program, it allows me to select all the items at one time. I
          want the user to only be able to select one item at a time. How do I do this?

          Thanks,
          Stephanie

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

          I just figured out what it was. In an earlier version of the dialog box, I was changing the color. I don't need that anymore, and when I took out the code, it started working as it should. Thanks for your help! Stephanie ================== The original message was: I had "Single" selected. It makes the list box gray (instead of white) and won't unselect
          item. ie. The default selection is String1. If you click on String2, both are blue. If you
          click again on String1, it stays blue. It's impossible to select only one string, unless you
          take the default. I'm not sure what's going on.

          Stephanie
          ==================
          The original message was:

          Hi,

          If you create list boxes explicitely using create function then make sure that you didn't specify LBS_EXTENDEDSEL or LBS_MULTIPLESEL style.
          If you use dialog editor for creating the template for your dialog then you have to display a property dialog for the list box control. On this dialog you have to select the second page "Styles" and in the "Selection" combo box you have to choose "Single" item

          Regards,
          Andrei Zenkovitch
          Dundas Software
          ==================
          The original message was:

          I have a dialog based app with three listboxes. I used AddString("") to add several items to
          each string. When I run the program, it allows me to select all the items at one time. I
          want the user to only be able to select one item at a time. How do I do this?

          Thanks,
          Stephanie

          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