Objective: On a form û display the required fields with a different background color so the user can easily determine the required fields.
This assumes you have a textbox as part of your library that you sub-classed.
1. Add a property on the textbox and name it: required
2. Add the following code in the refresh Method of the textbox:
IF Thisform.EditMode
IF This.Required
This.Backcolor = 8454143 && Yellow Background
ELSE
This.Backcolor = 16777215 && White Background
ENDIF
ENDIF
If you do not use the Edit-Mode methodology, remove the First IF statement of the nested-if. It is the THIS.REQUIRED piece of logic that is most important.
Tip: If you are not sure of the number value for the color, type the following in the command line and pick the color with your mouse:
? getcolor()
To test this. Drop 4 or 5 text fields on a form and set a couple of the required properties to .T. Execute the form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.