How require user to pick an item in a listbox?

Started by pguild, May 23, 2019, 10:56:09 PM

Previous topic - Next topic

pguild

If a user presses OK when a listbox is presented my program fails because nothing was selected and the program is expecting a value.
Is there a way to require the user to make a selection?
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer

td

There are several ways to do this.  The easiest might be to check for selection when the user attempts to exit the control via a close event or the OK button press in a dialog callback.  You might be best served by looking at a few examples of dialog-callback-subroutines in the Consolidated WIL Help file, Windows Interface Language Reference > Things to Know > Dialogs > Dialog Functions > Dialog.


"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade