Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toolbar in Screen

Status
Not open for further replies.

wadesnj

Programmer
Mar 24, 2001
36
How do I create a custom toolbar that appears in the main VFP screen with no forms open? My app just displays a splash screen, then is completely driven from the menu bar.
 
This totally depends on how you have implented your program/application.

If you have got a permanent toolbar in your application, I suggest you create it as a public object:

Like :
PUBLIC goMainToolBar
goMainToolBar = CREATEOEBJECT('MyMainToolBar')
goMainToolBar.Show()

Or if you are using a global application object, I suggest you attach it to your global application object.

HTH,

Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Thanks for the reply Weedz

I have a global app object, because I use the app wizard to build a skeleton app then bolted in all my stuff. Can I add a toolbar class that I have designed to this app object, and how do I do it? Also, do I have to create the toolbar programatically in code, or can I design it in the gui class designer?

Sorry if this is a bit basic, I haven't been programming in VFP for long!
 
If your global application object would be goApp, the only thing you have to do is to add a property to goApp f.i.

IF !PEMSTATUS(goApp, "oMainToolBar", 5)
*- Check if the property already exists
goApp.AddProperty('oMainToolBar', .NULL.)
goApp.oMainToolbar = CREATEOBJECT('MyToollBar')
ENDIF

As soon as you want it to be shown you can call the tool bar's show method.

goApp.oMainToolBar.Show()

and yes, you can design a toolbar class. Just type in the command window:

CREATE CLASS

and you'll be prompted to choose a name, type (Toolbar), and the classlibrary in which you want to place your class.
If you choose one of the classlibs already used, it will be Ok.

HTH,

Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top