WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: pguild on May 23, 2019, 10:56:09 PM

Title: How require user to pick an item in a listbox?
Post by: pguild on May 23, 2019, 10:56:09 PM
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?
Title: Re: How require user to pick an item in a listbox?
Post by: td on May 24, 2019, 08:00:18 AM
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.