Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Create/Active VFP Tool Bar…
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00875638
Message ID:
00876519
Views:
25
Hello Jean-Rene.

But when Wexit() return .f. How can I have the Report Controls Toll Bar?
Is there a command that I do not know?


This is what we had to say on the subject in 1001 Things You Wanted to Know About Visual FoxPro

How do I get rid of the system toolbars?

When you start Visual FoxPro, one or more of the system toolbars will normally be visible. (The actual toolbar status is stored in the Resource File.) Fortunately all of the system toolbars can be addressed using their window names (which are actually the same as their Captions) and so manipulating them is relatively simple.

The simplest way of ensuring that only those toolbars that you require are visible is to create an array of all the toolbar names, then loop through it, testing to see if each is visible and hiding those that are not required. The following code hides all visible system toolbars:
DIMENSION laTbState[11]
laTbState[ 1]="Color Palette"
laTbState[ 2]="Database Designer"
laTbState[ 3]="Form Controls"
laTbState[ 4]="Form Designer"
laTbState[ 5]="Layout"
laTbState[ 6]="Print Preview"
laTbState[ 7]="Query Designer"
laTbState[ 8]="Report Controls"
laTbState[ 9]="Report Designer"
laTbState[10]="Standard"
laTbState[11]="View Designer"
FOR lnCnt = 1 TO 11
  IF WEXIST(laTbState[lnCnt])
    HIDE WINDOW ( laTbState[lnCnt] )
  ENDIF
NEXT
Of course, this raises the issue of what happens if you then wish to re-display a system toolbar. Perhaps unsurprisingly, the SHOW WINDOW command can be used to re-display a previously hidden system toolbar, while RELEASE WINDOW will actually release the specified toolbar.

The system toolbar "Gotcha!"

But there is a catch! In order to use Show Window, the named window must have been defined to VFP and even though the System Toolbars are generated by VFP, there is no way of actually defining or activating the toolbars programmatically. The consequence is that unless a toolbar is first activated by VFP itself, you cannot later make it visible. The only toolbars that can be made visible by default are the 'Standard', 'Layout' and 'Form Designer' but there does not seem to be any reliable way of programmatically forcing any of the other system toolbars to be made visible at startup.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform