Maybe this was answered already, but this is the way I do it:

Create a toolbar as you like it and save as a class, ie mytoolbar, in  a 
class library (vcx)

Don't forget to set the showwindow property = 1 (in top level form)

** form init event
** this is how you instantiate the toolbar
** the call to pemstatus is so you don't get an error in case that, somehow, 
the toolbar is already instantiated

if not pemstatus(thisform,'oToolBar',5)
    thisform.oToolBar = createobject("myToolBar")
    thisform.oToolBar.show()
endif


** form destroy event
** this is how you kill it

if  pemstatus(thisform,'oToolBar',5)

   thisform.oToolBar = .NULL.

endif

You can use the show and hide methods of the toolbar as you wish. In my 
case, the toolbar has lots of buttons, such as vcr buttons, print, 
browse,add,cancel,delete,etc,etc.

I show it whenever I need it or hide it on demand as well.

BTW, you coordinate the toolbar's behaviour with the form thus:

** toolbar add button click event (used to add a record to a table)

_screen.activeform.add()  && you call the add method on the form

** toolbar next record navigation button

_screen.activeform.nextrec()

and so on

Regards

Rafael Copquin

----- Original Message ----- 
From: "MB Software Solutions,LLC" 
<[email protected]>
To: <[email protected]>
Sent: Monday, September 14, 2009 8:15 AM
Subject: Re: VFP9SP2 -- toolbars


> Allen wrote:
>> Yes indeed they are a mess but there is a way out. Make your toolbar 
>> class
>> and then Createobject instead of dropping on a form
>> Al
>
> Ok...got my toolbar class...now what...add it to the _screen via
> NewObject and then Dock it via something like _screen.ToolBar.Dock(1) ??
>
>
> -- 
> Mike Babcock, MCP
> MB Software Solutions, LLC
> President, Chief Software Architect
> http://mbsoftwaresolutions.com
> http://fabmate.com
> http://twitter.com/mbabcock16
>
>
[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
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/ccd45a166d3444ed88e5f976811a4...@rafael
** 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.

Reply via email to