09-15-2013 01:31 PM
hi
I have listbox and user can select multi lines but I would like to force the user to always select 4 lines . Could you please let me know hpow can I do it in program
Thanks
09-15-2013 01:34 PM
What do you want to have happen if the user selects less than 4 items? Or more than 4 items? Pop up a dialog box?
You can check the length of the array of the listbox. Do it in a while loop and only exit the loop if it is equal to 4. Pop up a dialog if it is not equal to 4.
09-15-2013 01:45 PM - edited 09-15-2013 01:59 PM
Easiest would be an event structure where you check the size of the listbox array. Set a flag once exactly four items are selected and e.g. enable a button that is disabled for any other number of items.
Typically users need to select one item at a time (e.g. by ctrl-clicking). So constantly throwing dialog boxes at the user would interfere strongly with the user experience. Not recommended).
09-15-2013 02:02 PM - edited 09-15-2013 02:02 PM
09-15-2013 04:59 PM
Also, be sure to inform the user of your expectations. Selecting 4 things from a single list is not likely to be something that a person would intuitively understand. Use on-screen instructions or tip strips to tell the user what you want. You could also have a count down indicator showing how many selections there are left to make.
Mike...
09-15-2013 05:27 PM
I like the count down indicator idea.
Lynn