HOWTO: Use the Wizard txtbtns Class in a Non-Wizard Form
ID: Q139597
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 5.0, 6.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
- 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
- Create a new form.
- Add a table to the form's data environment.
- Drag fields from the form's data environment to the form.
- Click the View Classes button in the form controls toolbar.
- Click Add, and then select the Wizbtns.vcx visual class library.
- Click the Txtbtns button on the form controls toolbar, and then click
the form.
- 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 query words:
Keywords : kbOOP kbVFp300 kbVFp500 kbVFp600
Version :
Platform :
Issue type : kbhowto