| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== DESTROY (remove a control) ====== | [[deletereg remove a value or key from windows registry .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[directory get file directory .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **DESTROY( **[ //first control// ] [,// last control //] **)** {{blk2blue.jpg|blk2blue.jpg}} | **DESTROY** | Removes window controls. | | //first control// | Field number or field equate label of a control, or the first control in a range of controls. If omitted, defaults to zero (0). | | //last control// | Field number or field equate label of the last control in a range of controls. | The **DESTROY** statement removes a control, or range of controls, from an APPLICATION or WINDOW structure. When removed, the control's resources are returned to the operating system. DESTROYing a GROUP, OPTION, MENU, TAB, or SHEET control also destroys all controls contained within it. **Example:** **Screen WINDOW,PRE(Scr)** **        ENTRY(@N3),USE(Ctl:Code)** **        ENTRY(@S30),USE(Ctl:Name)** **        BUTTON('OK'),USE(?OkButton),KEY(EnterKey)** **        BUTTON('Cancel'),USE(?CanxButton),KEY(EscKey)** **       END** ** CODE** ** OPEN(Screen)** ** ****DESTROY****(?Ctl:Code)              !Remove a control** ** ****DESTROY****(?Ctl:Code,?Ctl:Name)    !Remove range of controls** ** ****DESTROY****(2)                      !Remove the second control** **See Also:** [[create return new control created .htm|CREATE]]