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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set app_standardtoolbar property

Status
Not open for further replies.

Rich196

Programmer
May 17, 2003
42
US
I have an app which has a standard toolbar. I want to make it not visible. I have set the app_standardtoolbar.visible using the project manager class tab and selecting
app_standardtoolbar and setting visible=.f. I rebuild the app but the toolbar is still visible.

What am I doing wrong? Or is there another way to accomplish the task?

Thanks in advance,
Rich
 
Perhaps I have not been clear in stating the problem. What I mean to say is the aplication opens up displaying the standard toolbar. I do not want a toolbar displayed so in the load method of the first form I said:
HIDE WINDOW "STANDARD"

I rebuilt the application into a new exe and when it executes I get a message "WINDOW 'standard' has not been defined".

If it has not been defined how is it being displayed?

Then I went to the class for myapp_app and it showed an app_standardtoolbar which, when I open it, shows me the toolbar I want to get rid of. I set the visible property to .f. but it still displays. I rename app_standardtoolbar
and then I get an error "can't find app_standardtoolbar" which, when I IGNORE, gives me the intended outcome (just the menu and no toolbar). I am using VFP 8.
 
I'm confused...did you use a wizard to create this application? I haven't much experience with the wizards to tell you the truth, but what you are outlining seems extremely foreign to me... I am guessing. You may try using the _systoolbars class from the _app.vcx that comes with VFP. You'll find it in your VFP install dir underneath the FFC folder. It has a HideSystemToolbars method. Here's an example of it's use (cut-n-paste into a prg and run from within VFP or your program to see it in action):

Code:
x = NEWOBJECT("_systoolbars",HOME() + "ffc\_app.vcx")
x.hidesystemtoolbars()
Messagebox("System Toolbars should be hidden.  Now let's show them again.")
x.showsystemtoolbars()

...as for the error you are getting with the Hide Window command, you could do a check to see if the window exists and/or is visible. See WEXIST() and WVISIBLE() functions in the VFP help file. My feeling is that for whatever reason the Standard toolbar is not getting defined prior to your form load running...you may try using a later event or perhaps searching the code that is running your application to see where and when this toolbar is getting instantiated and made visible. One of the problems with using wizards, if that's what you are doing, is that you lose a lot of control and end up with situations like this. If you haven't used a wizard and something else is afoot here, then my sincerest apologies for my misunderstanding.

boyd.gif

 
Rich,

I'm a bit confused as well.

If your aim is to hide VFP's main toolbar, use this code:

IF WEXIST("Standard")
HIDE WINDOW "Standard"
ENDIF

But that's got nothing to do with creating your own toolbar class.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Thanks Craig and Mike for your suggestions. I tried them all to no avail. After much gnashing of teeth and tearing of hair I finally think I have it. The problem is that there are two toolbars called standard. I used the App Wizard to build the framework and it subclasses a bunch of things from _framework.vcx one of which is app_standardtoolbar. This tool bar is not the full system standard toolbar but only shows 8 or 9 icons.

I found that myapp_app contained app_application which has a cstartuptoolbarclass_access method where I inserted the following:

this.lstartuptoolbar = .f.

to force a null being returned for the toolbar class.

I still have further testing but I believe that has taken care of my problem.

Thanks to you both for your replies and suggestions.

You're right Craig, Wizards can be helpful but they sure can be a pain when you need something specific.

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top