You have to make sure the toolbar.ShowWindow = 1 (In Top Level Form) Rick White Light Computing, Inc.
www.whitelightcomputing.com www.rickschummer.com 586.254.2530 - office 586.254.2539 - fax -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Crozier Sent: Tuesday, June 27, 2006 10:23 AM To: [EMAIL PROTECTED] Subject: RE: Docking Toolbar in Top-Level Form Rafael, I still have the same problem - The sample below just docks the toolbar on the main VFP window ************** * 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 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("Toolbar") With This.barToolbar2 as toolbar .AddObject("btnButton1","CommandButton") .btnButton1.Visible=.T. * .Dock(0) .Show() Endwith Endif * Endfunc Function Unload() Clear Events Endfunc * * Enddefine * * End of Code *********** 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 Rafael Copquin Sent: 27 June 2006 14:40 To: profox@leafe.com Subject: Re: Docking Toolbar in Top-Level Form I use a top level form as the background for my applications and dock a custom made toolbar which is used by all the forms launched from the menu. This is the code I use in the ACTIVATE method of the TLF If this.lFirstTime = .t. this.lFirstTime = .f. this.LockScreen = .t. ** the next two lines center the company logo on the TLF (which has a windowsstate property of 2 (maximized) ) this.logo.Left = (Sysmetric(1) - this.logo.Width ) / 2 this.logo.top = (Sysmetric(2) - this.logo.Height) / 2 application.Visible = .f. && place this here to avoid initial flicker this.LockScreen = .f. If Vartype(this.oToolBar) <> "O" this.oToolBar = createobject("myToolBar") this.oToolBar.dock(0) this.oToolBar.show() endif Release Menus (this.Name) extended && not really needed but..... Do general.mpr with this,.t. EndIf As you can see, the lFirstTime property causes both the toolbar and the menu to show when the TLF activates. The toolbar is always there (as is the menu) and is used by all forms that need it. When they do not need it, the form class deactivates de toolbar, leaving only the exit button enabled. The toolbar has navigation buttons, add,delete,cancel,edit,charts,word,excel, etc. buttons and also an exit button. Rafael Copquin www.copquin.com.ar Universal Thread Magazine - Translation Coordinator Treasurer - Microsoft Users Group of Argentina (MUG) www.mug.org.ar ----- Original Message ----- From: "Dave Crozier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 27, 2006 10:16 AM Subject: Docking Toolbar in Top-Level Form > Problem: > I'm trying to make a top level form in which a toolbar is dockable. > > So Far: > If I create a form which is set as a "Top-Level" with Desktop=.T. and add > a > toolbar in the init() of the form as follows: > > With This > .AddProperty("barToolbar") > .barToolbar=NewObject("Organiser_Toolbar","stdControls") > .barToolbar.Visible=.T. > > * Bind My Event to the first Toolbar Button > * This binding fires correctly > =BindEvent(Thisform.barToolbar.btnOpen,"Click",This,"btnOpen") > * > Endwith > * > Return > > The toolbar is created but will only dock with the main VFP window and not > the new top-level form I created. So, how do I make the new top level form > the place where the toolbar will dock? I have the feeling I've missed > something really basic here - but I can't think what. > > Anyone any ideas as I've never really got into toolbars and I know there > are > a few "gotcha's"? > > > 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: ProFox@leafe.com 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.