How To Use the Wizard txtbtns Class in a Non-Wizard Form

Last reviewed: October 17, 1996
Article ID: Q139597
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 5.0
  • Microsoft Visual FoxPro for Macintosh, version 3.0b

SUMMARY

The Form wizard can create a fully functional data entry form for any table. The form generated by this wizard contains a standard button bar that provides navigation, editing, end searching functionality. It is possible to also use this button bar in forms not created by the Form wizard.

MORE INFORMATION

To use the wizard button bar in a form not created by the Form Wizard, create a new visual class library to be used separately from the Wizstyle.vcx visual class library. To do this, either subclass the txtbtns class in the Wizstyle.vcx visual class library, or create a new visual class library using the ADD CLASS command.

If the new class is created by subclassing the txtbtns class in the Wizstyle.vcx visual class library, it will inherit any future changes that are made to the txtbtns class. However, if the new class is created using the ADD CLASS command, it will not be affected by any future changes made to the txtbtns class in the Wizstyle.vcx visual class library.

Once the new class has been created, it can be added to a form.

Subclassing the Txtbtns Class

  1. Type the following in the Command window to create a new class:

          CREATE CLASS
    

  2. Type txtbtns in the Class Name box.

  3. Click the three-dot button next to the Based On box, and then select the txtbtns class in the Wizstyle.vcx visual class library.

    NOTE: The Wizstyle.vcx visual class library is located in the Vfp\Wizards directory.

  4. Type Wizbtns.vcx in the Store In box.

  5. Save and close the Class Designer.

Using the ADD CLASS command

To create the new class using the ADD CLASS command, type the following in the Command window:

   ADD CLASS txtbtns OF SYS(2004)+"Wizards\Wizstyle.vcx" TO Wizbtns.vcx

Adding the Txtbtns class to a form

  1. Create a new form.

  2. Add a table to the form's data environment.

  3. Drag fields from the form's data environment to the form.

  4. Click the View Classes button in the form controls toolbar.

  5. Click Add, and then select the Wizbtns.vcx visual class library.

  6. Click the Txtbtns button on the form controls toolbar, and then click the form.

  7. Save and run the form.

Note: The txtbtns class relies on the fact that the forms created by the Form wizard use buffering. The new txtbtns class will inherit this same dependency. The default setting of buffering on a form is 0-None. For these buttons to be fully functional, the forms buffering property must be set to either 1-Pessimistic or 2-Optimistic.


Additional reference words: 5.00 VFoxMac 3.00b 3.00 VFoxWin oop
KBCategory: kbprg kbtool kbhowto
KBSubcategory: FxprgClassoop


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: October 17, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.