Tuesday, March 1, 2011

How to Restrict the Values a Control can Get

Restricting a Simple Numeric Control:
  1. Double click on the control to edit its properties.
  2. Select the best data type for the job (char, int, double and should it be unsigned). 
  3. Specify the minimum and maximum values.
  4. Change "Range Checking" to 'Coerce' so that the values are truly restricted (otherwise the user will only be  notified). In 'Coerce' mode, if the user enters a value that is larger than the maximum, the value that will be entered is the maximum value, the same goes for the minimum for values that are lower.
Restricting a String Control:
  1. Double click on the control to edit its properties.
  2. The default value of -1 in "Max Entry Length" will allow the user to enter as many characters as he wishes (no restriction) - Change the value to the maximum number of characters you want the user to enter.

No comments:

Post a Comment