How to Hide Deactivated Screens in a Screen Set

ID: Q112599

2.50 2.50a 2.50b | 2.00 2.50 2.50a 2.50b | 2.50b

WINDOWS          | MS-DOS                | MACINTOSH

The information in this article applies to:

SUMMARY

When you are generating a screen set with multiple screens in the Screen Builder, you may want to hide the deactivated screens until they are needed. If the other screens are not hidden, they will appear on the desktop unless the activated window is large enough to keep them from being seen. Below is the code needed to hide any two deactivated screens of a three-window screen set.

MORE INFORMATION

 1. Create a screen called SCR_ONE.

 2. From the Screen menu, choose Layout. In the Name box, type "firstscr"
    (without quotation marks). If you are using FoxPro for Windows or
    Macintosh, click the Code button, and then click On Window Activate.
    If you are using FoxPro for MS-DOS, select the Activate check box. In
    this box, type:

       HIDE WINDOW secondscr
       HIDE WINDOW thirdscr

 3. From the Screen menu, choose Layout. If you are using FoxPro for
    Windows or Macintosh, click the Code button again and click the Screen
    Setup Code button. If you are using FoxPro for MS-DOS, click the Setup
    check box. Type the following code:

       abc=.F.

    This variable will be used to keep SCR_ONE from being hidden when
    the program starts up.

 4. Create a push button with the prompts "SCREEN2" and "SCREEN3" (without
    quotation marks). Give it the variable name "m.scr1" (without
    quotation marks). In the VALID clause of the push button, type this
    code:

       DO CASE
         CASE m.scr1 = 1
           _CUROBJ=OBJNUM(m.scr2)
         CASE m.scr1 = 2
           _CUROBJ=OBJNUM(m.scr3)
       ENDCASE
       abc=.T.

 5. Create a screen called SCR_TWO.

 6. Repeat step 2, and in the Name box type "secondscr" (without quotation
    marks). In the Activate box, type:

       IF abc =.T.
         HIDE WINDOW firstscr
       ENDIF
       HIDE WINDOW thirdscr

 7. Create a push button with the prompts "SCREEN1" and "SCREEN3" (without
    quotation marks). Give it the variable name "m.scr2" (without
    quotation marks). In the VALID clause of the push button, type this
    code:

       DO CASE
         CASE m.scr2 = 1
           _CUROBJ=OBJNUM(m.scr1)
         CASE m.scr2 = 2
           _CUROBJ=OBJNUM(m.scr3)
       ENDCASE

 8. Create a screen called SCR_THRE.

 9. Repeat step 2, and in the Name box, type "thirdscr" (without quotation
    marks). In the Activate box, type:

       IF abc =.T.
         HIDE WINDOW firstscr
       ENDIF
       HIDE WINDOW secondscr

10. Create a push button with the prompts "SCREEN1" and "SCREEN2" (without
   quotation marks). Give it the variable name "m.scr3" (without quotation
   marks). In the VALID clause of the push button, type this code:

        DO CASE
          CASE m.scr3 = 1
            _CUROBJ=OBJNUM(m.scr1)
          CASE m.scr3 = 2
            _CUROBJ=OBJNUM(m.scr2)
        ENDCASE

11. Bring up SCR_ONE, and choose Generate from the Program menu. Add
   SCR_TWO and SCR_THRE to the screen set, and then generate the set.

12. In the Command window, type "do scr_one.spr" (without quotation marks).

The screens will flash up one at a time. In FoxPro for Windows or Macintosh, this flashing may be more noticeable than it is FoxPro for MS-DOS; nothing can be done about it. SCR_ONE will settle on the screen along with the SCREEN2 or SCREEN3 push buttons. If you choose one of these push buttons, SCR_ONE will be hidden and whichever screen is chosen will appear.

For more information about how to keep the screens from flashing when the screen set starts up, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119692
   TITLE     : How to Keep Screens from Flashing in Multiple-Screen
               Set

Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b KBCategory: KBSubcategory: FxtoolSbuilder
Keywords          : kbcode FxtoolSbuilder 
Version           : 2.50 2.50a 2.50b | 2.00 2.50 2.5
Platform          : MACINTOSH MS-DOS WINDOWS

Last Reviewed: May 22, 1998