How To Make a PageFrame Work with the Wizard Txtbtns Class

Last reviewed: August 29, 1997
Article ID: Q140849
3.00 3.00b 5.00 WINDOWS kbprg kbhowto kbcode

The information in this article applies to:

  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0

SUMMARY

This article shows by example how to make the Wizard TxtBtns class from the WizStyle.vcx library work on a form that also holds a PageFrame. By default, TxtBtn and PageFrame classes do not function properly together. This article shows you how to overcome this limitation.

MORE INFORMATION

Step-by-Step Example

  1. Create a new form by using the Form Wizard or by creating a form of your own. Add the TxtBtns. For more information, please see the following article in the Microsoft Knowledge Base:

    ARTICLE-ID: Q139597

       TITLE     : How To Use the Wizard txtbtns Class in a Non-Wizard Form
    
       Be sure to set the form's Buffermode property to 1 or 2 and set the
       Enabled property of each control on the form to False (.F.).
    
    

  2. Add a PageFrame to the form, and add some text boxes to the pages.

  3. Set the Enabled property for each text box in the PageFrame to False (.F.).

  4. In the Click event of the cmdAdd button, add this code:

          * Note: Repeat the second line for each page in the PageFrame
          * substituting the appropriate name for each page
          txtbtns.cmdAdd::click()
          thisform.pageframe1.page1.setall("enabled",this.parent.editmode)
          thisform.pageframe1.setall("enabled",.t.,"label")
    

  5. In the Click event of the cmdEdit button, add this code:

          * Note: Repeat the second line for each page in the PageFrame
          * substituting the appropriate name for each page
          txtbtns.cmdEdit::click()
          thisform.pageframe1.page1.setall("enabled",this.parent.editmode)
          thisform.pageframe1.setall("enabled",.t.,"label")
    

  6. Save and run the form.

REFERENCES

For more information about using Wizard TxtBtns in forms in Visual FoxPro for Windows, please see the following articles in the Microsoft Knowledge base:

   ARTICLE-ID: Q134704
   TITLE     : How To Add Controls to a Screen Generated by the
               Screen Wizard

   ARTICLE-ID: Q134790
   TITLE     : How To Add Code to Wizard-Generated Command Buttons

   ARTICLE-ID: Q139597
   TITLE     : How To Use the Wizard TxtBtns Class in a Non-Wizard Form


Additional reference words: 5.00 3.00 3.00b VFoxWin
KBCategory: kbprg kbhowto kbcode
KBSubcategory: FxprgGeneral
Keywords : FxprgGeneral kbcode kbhowto kbprg
Version : 3.00 3.00b 5.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.