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!

Hiding the title bar

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
My application displays the standard VFP title bar. This displays “Application XYZ” and on the right the standard Windows buttons for closing or minimising the screen.

The main menu is in the form of a Toolbar; this contains a button “Application XYZ” (effectively highlighted) and also a button “Application ABC” so that one can switch between them (and get a different menu).

So, being of an economical turn of mind, I feel I do not need the standard VFP title bar, and I switch it off with :

Code:
_screen.TitleBar = 0

However this unfortunately removes the standard screen management buttons.

Is there a way that I can retain these (perhaps by moving them onto my menu toolbar, where I would gladly make space)?
And is there any difference in the way these things are presented when I run application XYZ from its own .exe file, rather than under VFP9 development?

Thanks. Andrew
 
Andrew,

What do you mean by the "screen management buttons"? Do you mean the Minimise, Maximise and Close buttons? If so, you can indeed add these to your main menu. You will need to write three functions, to minimise, maximise and close the form respectively. Each of these should receive an object reference to the form (or it can use _SCREEN.ActiveForm). You then set the form's WindowState property to the appropriate value, or call its Release method.

If that's not what you meant, perhaps you could clarify.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
If you see the title bar of your toolbar, it's a sign this isn't docked. Normal users would dock a toolbar, as that saves that place and therefore, if I were you, I'd rather see how to automatically dock the toolbar into the _screen to avoid the double title bar.

By the way it's simply object.Dock(0), which docks an object (toolbar or form) to the top of the screen, as seen here:

Code:
o = CreateObject("toolbar")
o.AddObject("cmd1","commandbutton")
o.Dock(0)
o.cmd1.Visible=.T.
o.Visible=.t.

To state the maybe not so obvious: It's a normal state for a toolbar to be docked. If it's undocked, it should have it's own caption.

Bye, Olaf.
 
Andrew, having read Olaf's reply, I realise that the form in question is a toolbar. So forget what I said about adding menu functions (although these would still work, it's not what you want).

I would normally keep a toolbar permanently docked. To do so, I call its Dock method at Init time, and then set its Movable propertly to .F. to prevent users undocking it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike. I mean the three buttons at the top right of the application window (so, on the right of the title bar).

I particularly wish to still offer the user the option to close the application.

pic01_wz1lnw.png


If I put a button on my menu to execute _screen.activeform.release, this closes one of the windows on the screen (in this case, the Customer Maintenance window), whereas I would like to offer the user a button to close the whole application (reverting to the standard VFP screen); this is what the X button at the end of the title bar does.

Thanks Olaf. I will investigate the business of docking a toolbar.
 
The real question is why is your app running in the VFP IDE instead of as a standalone EXE?

(That's the only reason to as for "reverting to the standard VFP screen".)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top