| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > RuleManager > RulesCollection Class Methods >====== AddControl (add managed control ) ====== | [[rulescollection class methods.htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[addcontoltorule add managed control .htm|{{btn_next_n.gif|Next page}}]] | | || **AddControl( **//feq//,//action// **)** {{blk2blue.jpg|blk2blue.jpg}} | **AddControl** | Adds a control to the controls queue so that a specified action is taken when any rule in the managed collection is broken. | | //feq// | A numeric constant, variable, EQUATE, or expression that indicates the Field Equate number of a control whose hidden or disabled status will be determined by the existence of one or more broken rules. | | //action// | A numeric constant, variable, EQUATE, or expression that indicates the action to be taken with respect to this control when a rule is broken, defined as follows: | | RuleAction:None | EQUATE(0) | | RuleAction:Hide | EQUATE(1) | | RuleAction:UnHide | EQUATE(2) | | RuleAction:Disable | EQUATE(3) | | RuleAction:Enable | EQUATE(4) | **Example:** **  Customer.SetErrorImage('~BRuleNo.ico')** **  Customer.SetDescription('Customer File Rules')** **  Customer.AddRule('StateRequired','State is required','cus:State <;<;> ''''',?cus:State,3)  ** **  Customer.AddRule('ZipOK','Postal code must have valid format.',** **                   'CheckCustomerZip()',?cus:ZipCode,3)  ** **  Customer.AddRule('CreditLimit','Credit limit must not exceed $1000.00',** **                   'cus:CreditLimit =<;<; 1000',?cus:CreditLimit,3)** **  Customer.AddControl(?Ok,RuleAction:Disable) ! Disable OK button if any rule broken**