| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ToolbarClass > ToolbarClass Methods >====== SetTarget (sets the active target) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[kill shut down the toolbarclass object .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[takeevent process toolbar event toolbarclass .htm|{{btn_next_n.gif|Next page}}]] | | || **SetTarget( **[// ID //] **)** {{blk2blue.jpg|blk2blue.jpg}} | **SetTarget** | Sets the ToolbarClass object's active toolbar target. | | //ID// | An integer constant, variable, EQUATE, or expression containing the //target//'s ID number. For targets associated with a control, this is the control number (usually represented by the control's Field Equate Label). If omitted or zero (0), SetTarget sets the most likely target. | The **SetTarget **method sets the ToolbarClass object's active toolbar target (ToolbarTarget object), and adjusts the TOOLBAR state appropriate to that target. **Implementation:** The SetTarget method calls the ToolbarTarget.TakeToolbar or ToolbarTarget.TryTakeToolbar method to set the toolbar buttons' TIP attributes and enabled/disabled status appropriate to the active toolbar target. **Example:** ** ACCEPT** **  CASE EVENT()** **  OF EVENT:OpenWindow             !on open window** **   DO RefreshWindow               !load the browse QUEUEs** **  OF EVENT:Accepted               !for Accepted events (which may** **   CASE FOCUS()                   ! come from the global toolbar)** **   OF ?ClientList                 ! make the list with FOCUS** **    Toolbar.SetTarget(?ClientList)! the active toolbar target** **   OF ?PhoneList                  ! and enable appropriate toolbar** **    Toolbar.SetTarget(?PhoneList) ! buttons and TIP attributes** **   END** **   Toolbar.TakeEvent(VCRRequest, WM)     !the Toolbar object calls the ** **  END                      ! active target's event handler** ** END                       ! which in turn scrolls, inserts,** **                           ! deletes, helps, etc. The event** **                           ! handler often simply POSTs** **                           ! another event to the correct** **                           ! control, e.g. ** **                           ! Event:Accepted to ?Insert  or** **                           ! Event:PageUp to ?ClientList** **See Also:     **[[taketoolbar assume control of the toolbar toolbartarget .htm|ToolbarTarget.TakeToolbar]], , [[trytaketoolbar return toolbar control indicator toolbartarget .htm|ToolbarTarget.TryTakeToolbar]]