Need listbox that can scroll but not allow user to change selection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qvklm1
    New Member
    • Feb 2010
    • 1

    #1

    Need listbox that can scroll but not allow user to change selection

    I have a form where the user can add different criteria. Then, also on that form, I have a listbox with all possible items. When the user changes the criteria, I want to indicate in the listbox which items match the criteria. If I use SetSelected, the items get highlighted, like I want, however, it is possible for the user to click in the listbox and change the selection. If I set the enabled property of the listbox to false, then the user cannot change the selection, but they also cannot scroll the listbox to see all of the selected items.

    Is there a way to allow the scrollbars to work, but not allow the user to change the selections in the listbox (perhaps with mouse events), or is the answer to choose another control (not listbox) that will do what I would like? I want to show both the selected and non-selected items in the same control, so the user can see where the "gaps" are helping them to know if they need to change the criteria they entered.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    What about a CheckedListBox?

    Since I can't see the form I don't completely understand why you are selecting criteria *over here* then showing the selections *over there*. It seems to me that you could just use the CheckedListBox to simplify the GUI and handle both needs.

    Comment

    Working...