>Greetings!
>
>I have a tool bar which loads before selecting a form from a menu to display. When the form is first loaded, it can "see" and reference the tool bar. Then, if the form is unloaded and re-loaded from the menu, it can no longer reference the tool bar, generating errors instead. From what I can see, everything is the same the second time through as with the first.
>
>I understand that the tool bar can be a part of the form's form set, however, since I have multiple form sets, all needing to access the same tool bar, I seem to only ask for trouble by embedding the same tool bar into each form set. Therefore, what can be done??
>
>Thanks!
>
>Michael Reynolds
Michael, I don't know exactly how you setup your toolbar and reference the toolbar from the form, but the usual way to have the common toolbar is to create this toolbar in Application object and have something like that in Form.Init()
if type("oApp")=="O"
if !empty(thisForm.cToolBarClass)
if isnull(thisForm.oToolBar)
thisForm.oToolBar = oApp.AddToolBar(thisForm.cToolBarClass)
if !thisForm.lShowToolBar
if type("thisForm.oToolBar")="O" and !isnull(thisForm.oToolBar)
thisForm.oToolBar.visible = .f.
endif
endif
endif
endif
endif
oApp.AddToolBar should check if toolbar already exists.
HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison