Hi Dave,
I have the following code running with a visually designed form and toolbar.
The code was generated from the SCX and VCX using the class-browser and
trimmed down to it's bare essentials.
Regards,
Sietse Wijnker
<VFPCODE>
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
ShowWindow = 2
PROCEDURE Activate
IF TYPE([This.TB.Name]) <> [C] THEN
This.AddProperty("tb", CREATEOBJECT("tb"))
This.tb.Visible = .F.
ENDIF
IF NOT This.tb.Visible THEN
This.tb.Dock(0)
This.tb.Show()
ENDIF
ENDPROC
ENDDEFINE
DEFINE CLASS tb AS toolbar
ShowWindow = 1
ADD OBJECT command1 AS commandbutton WITH ;
Caption = "..."
ENDDEFINE
</VFPCODE>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dave Crozier
> Sent: dinsdag 27 juni 2006 17:33
> To: [EMAIL PROTECTED]
> Subject: RE: Docking Toolbar in Top-Level Form
>
> To All,
> Having investigated the problem further and unless anyone can
> prove me wrong, there is no way of having a visually designed
> Form with a visually designed toolbar which is docked in the
> aforesaid form and to run it in development mode to see the
> final result i.e the toolbar DOCKED IN the form.
>
>
> The main VFP screen seems to take control as the top level
> form and the toolbar will ALWAYS dock with the main VFP
> window regardless of which property settings you use.
>
> One lesson learnt.
>
> Dave Crozier
> "A computer is a stupid machine with the ability to do
> incredibly smart things, while computer programmers are smart
> people with the ability to do incredibly stupid things. They
> are, in short, a perfect match" - Bill Bryson
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dave Crozier
> Sent: 27 June 2006 15:47
> To: 'ProFox Email List'
> Subject: RE: Docking Toolbar in Top-Level Form
>
> Rafael,
> Solved the Problem. I needed to define the Toolbar as a class
> in its own right and set the ShowWindow property accordingly.
> Also, I just noticed the post from Rick which says the same
> thing. Funny that as in my application I use a visually
> designed class that is subclassed from a standard toolbar.
> Only in the subclass is the ShowWindow set to 1 and this is
> why it didn't work.
>
> Creating the class as the original toolbar where Showwindow
> is 0 screws everything else up even though I had the
> subclassed item set correctly.
>
> * Test Program for toolbars
> oForm=CreateObject("clsForm")
> With oForm
> .Width=200
> .Height=200
> .AutoCenter=.T.
> *
> .Visible=.T.
> *
> Endwith
> *
> Read events
>
>
> Define Class clsForm as Form
> ShowWindow=2 && Top Level
> Desktop=.T.
>
> Function Activate()
> * See if the toolbar exists
> * ...So I can rename init() as Activare for testing
> *
> If type("This.barToolbar")<>"O"
> This.AddProperty("barToolbar2")
> This.barToolbar2=CreateObject("clsMyToolbar")
> With This.barToolbar2 as toolbar
> .Dock(0)
> .Show()
> Endwith
> Endif
> *
> Endfunc
>
> Function Unload()
> Clear Events
> Endfunc
> *
> *
> Enddefine
>
> Define Class clsMyToolbar as Toolbar
> ShowWindow=1
>
> Function Init()
> With This
> .AddObject("btnButton1","CommandButton")
> .btnButton1.Visible=.T.
> .btnButton1.Height=30
> *
> .AddObject("btnButton2","CommandButton")
> .btnButton2.Visible=.T.
> .btnButton2.Height=30
> *
> Endwith
> *
> Endfunc
> *
> Enddefine
>
>
> Dave Crozier
> "A computer is a stupid machine with the ability to do
> incredibly smart things, while computer programmers are smart
> people with the ability to do incredibly stupid things. They
> are, in short, a perfect match" - Bill Bryson
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.9.5/376 - Release
> Date: 26/06/2006
>
>
>
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.