Establishes link between a toolbar and a form.

Syntax

<toRef>.attach(<oRef>)

<toRef>

An object reference to the toolbar.

<oRef>

An object reference to the form.

Property of

ToolBar

Description

Along with detach( ), this method lets you manage toolbars in your application by connecting and disconnecting the objects as needed.

Typically, however, a toolbar is attached when a form calls a program in which the toolbar is defined, as is done in the included CLIPBAR.PRG sample:

parameter FormObj, bLarge

private typeCheck 

local t, bNew 

bNew = false 

if ( PCOUNT() == 0 ) 

MSGBOX("To attach this toolbar to a form use: " + ; 

CHR(13) + CHR(13) + ; 

"DO " + PROGRAM() + " WITH <form reference>","Alert") 

else 

typeCheck = FindInstance("ClipToolbar") 

if ( TYPE("typeCheck") == "O" ) 

t = typeCheck 

else 

SET PROCEDURE TO (PROGRAM()) ADDITIVE 

t = new ClipToolbar( bLarge ) 

bNew := true 

endif 

t.attach( FormObj )  

endif 

return ( bNew )