>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 want to make the toolbar visible only when your form is on top, you have to do some additional programming (like in Form.Activate() and Form.Deactivate()).
HTH, 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)