The call to the customer window from the rental window illustrates the proper calls in this case. In the RentalForm the Confirm Rental button cannot be pressed unless all of the appropriate entries are filled in and the customer is confirmed. When the function confirmed is called from the customer form, this might be the last thing that is needed to enable the Confirm Rental button, so the button enabler is called from confirmed. These functions are given below. One function is used to check to see if any of the components has been changed.
Numerical components have the usual filter put on the OnKeyClicked event.
Most of the OnChange handlers for TEdit and TEditMask components simply set the corresponding checkboxes Enable property true if there is something in the box. The state change must also check to see if this is a legal state abbreviation by searching the list of abbreviations. If the typed text is not in the abbreviation list, a messagebox indicate this. The checkbox is not enabled until a legal abbreviation is entered or selected. Make sure cusor is at the end of the line.