Can anyone tell me if it is at all possible to dock a toolbar on a
regular, vanilla, run-of-the-mill form? I have tried dabbling with
formsets, but it seems that the foxpro toolbar only likes to be docked
onto the 'main frame'. I say 'main frame' because my experience is
from the MFC world.

Thanks for your help!

Re: Adding a toolbar to a vanilla form by Anders

Anders
Wed Dec 01 17:12:06 CST 2004

Yes it's possible to have Toolbar in a Top Level form (Form.ShowWindow=2).
I'd have to check the annals to see exactly how it was done. A CreateObject
in Form.Activate or something like that. I'll try and find it or someone
beats me to it.
-Anders

"Aaron Hudon" <xyz123@shaw.ca> wrote in message
news:790b609a.0412011416.26e8ba8f@posting.google.com...
> Can anyone tell me if it is at all possible to dock a toolbar on a
> regular, vanilla, run-of-the-mill form? I have tried dabbling with
> formsets, but it seems that the foxpro toolbar only likes to be docked
> onto the 'main frame'. I say 'main frame' because my experience is
> from the MFC world.
>
> Thanks for your help!


Re: Adding a toolbar to a vanilla form by Anders

Anders
Thu Dec 02 07:04:16 CST 2004


"Aaron Hudon" <xyz123@shaw.ca> wrote in message
news:790b609a.0412011416.26e8ba8f@posting.google.com...
> Can anyone tell me if it is at all possible to dock a toolbar on a
> regular, vanilla, run-of-the-mill form? I have tried dabbling with
> formsets, but it seems that the foxpro toolbar only likes to be docked
> onto the 'main frame'. I say 'main frame' because my experience is
> from the MFC world.
>
> Thanks for your help!

oform=create('formclass')
oform.show
read events

define class formclass as form
showwindow=2
otool=null
function init
this.visible=.t.
this.otool=createobject('toolbarclass')
this.otool.show
this.otool.dock(2)
function destroy
clear events
enddefine

define class toolbarclass as toolbar
showwindow=1
dimension aTools(6,2)
function init
for i = 1 to 6
ocmd="cmd"+tran(i)
osp='sp'+tran(i)
this.addobject(ocmd,'commandbutton')
this.addobject(osp,'separator')
this.atools(i,1)=this.&ocmd
this.atools(i,2)=this.&osp
with this.atools(i,1)
.caption=ocmd
.height=30
.width=60
.visible=.t.
endwith
next
enddefine

*-Anders