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

Programmatically Activate VFP8 Standard Toolbar

Status
Not open for further replies.

mikemck7

Technical User
Dec 17, 2003
38
Is it possible to redisplay the Standard toolbar from the Command window or from within a program when the toolbar was closed manually and WEXIST("Standard") returns .F. ?
 
Code by Sergey Berezniker:
Code:
IF WEXIST("Standard")
  ACTIVATE WINDOW Standard
ELSE
  KEYBOARD "{ALT+V}{ENTER}{PGDN}{UPARROW}{SPACEBAR}{CTRL+W}"
ENDIF
 
I don't know any way to do it from within a program if WEXIST() returns .F.

From the command window, you can do it interactively by going to the View menu. If you want a shortcut, you can record a keyboard macro that generates the following keystrokes:

Code:
Alt+V
T
S
space
enter

Assign the macro to single function key, and hit that key to toggle to toolbar.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Ilyad

ACTIVATE WINDOW Standard

Have ever tried this line? I throws an error. Althought the code you suggested looks right, it actually never reaches the line that gives an error because this line is never true

Code:
IF WEXIST("Standard")



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Yes, the code works fine for me. If the standard toolbar is hidden, this code shows the toolbar. If it was closed, the else condition fires.
 
I had no problem using the code in my program except that when I tried docking or undocking the Standard window by issuing:

DOCK WINDOW Standard POSITION ?

within the same IF/ENDIF block, I get the "Window 'STANDARD' has not been defined" error.

I believe this to be a keyboard buffering issue. So as a work-around I placed the DOCK WINDOW command in its own IF/ENDIF block and that seemed to take care of it.

Thanks Ilyad and Mike L. for your suggestions.

Mike M.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top