>>Hi Guys
>> Well now I am trying to put a toolbar on a top level form. In my toolbar
>>class I have show window set to in top level form. In the forms init method
>>I have the code :
>>
>>DO mnuMain.mpr WITH this
>>This.AddObject("oTbar","tbrMain")
>>oTBar.Visible = .t.
>>oTBar.Dock(0)
>>oTbar.Show()
>>
>>When I run the form I get the error [Object class is invalid for this container].
>>
>>Can anybody help. Thanks
>
>Some objects can be included within others, some not.
>
>A tool can only exist independently, similar to a form.
>
>You have to create it separately:
>
>
>oTBar = CreateObject("oTbar")
>oTBar.Show()
>
If you use variable oTBar, the toolbar will be killed as soon as the variable goes out of scope.
If you want to "attach" the toolbar to a form, you may want to use a form property instead. The toolbar will automatically be destroyed with the form.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)