Microsoft KB Archive/139597

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

Article ID: 139597

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Visual FoxPro 8.0 Professional Edition
 * Microsoft Visual FoxPro 7.0 Professional Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh
 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q139597



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
  Type the following in the Command window to create a new class: CREATE CLASS  Type txtbtns in the Class Name box. 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. Type Wizbtns.vcx in the Store In box. 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.

Keywords: kbcontrol kbwizard kbhowto kboop KB139597

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.