GUI ScreenIO for Windows

 ScreenIO.com


Data Validation

When you create an edit control, you can also tell GUI ScreenIO to ensure that the value entered in the edit control is valid.  You do this by checking the Data validated box in the properties of the edit control.

Now you can create a list of values that GUI ScreenIO will accept in this control.  The default range indicator is a colon (:), but in this example we changed it to a dash (-).  If you are defining a list of numeric items, you'd use the colon because the dash would be confused with a minus sign.

In this sample, GUI ScreenIO will accept values of A, C through G, O, and R in the field.  If you attempt to enter some other value, GUI ScreenIO will issue an error message that looks like this:

...which should look familiar; it's the list of valid entries that you specified in the editor!  In this example, the message is placed in the statusbar, but if you had specified that error messages be placed in a messagebox, GUI ScreenIO would display this text in a messagebox.

Validation is a feature of legacy ScreenIO that was preserved in GUI ScreenIO; you may find it more Windows-compliant to use a combobox, listbox, or listview control where you know the valid items beforehand.

Related topics:


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom