KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q140849: HOWTO: Make a PageFrame Work with the Wizard Txtbtns Class

Article: Q140849
Product(s): Microsoft FoxPro
Version(s): WINDOWS:3.0,3.0b,5.0,6.0
Operating System(s): 
Keyword(s): kbcode kbnokeyword kbvfp300 kbvfp500 kbvfp600
Last Modified: 11-DEC-1999

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 6.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:

  Q139597 HOWTO: 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:

  Q134704 HOWTO: Add Controls to a Screen Generated by the Screen Wizard

  Q134790 HOWTO: Add Code to Wizard-Generated Command Buttons

  Q139597 HOWTO: Use the Wizard TxtBtns Class in a Non-Wizard Form

Additional query words:

======================================================================
Keywords          : kbcode kbnokeyword kbvfp300 kbvfp500 kbvfp600 
Technology        : kbVFPsearch kbAudDeveloper kbVFP300 kbVFP300b kbVFP500 kbVFP600
Version           : WINDOWS:3.0,3.0b,5.0,6.0
Issue type        : kbhowto

=============================================================================

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.

Copyright Microsoft Corporation 1986-2002.