How To Make a PageFrame Work with the Wizard Txtbtns Class (140849)



The information in this article applies to:

  • Microsoft Visual FoxPro 8.0
  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft Visual FoxPro for Windows 6.0
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 3.0

This article was previously published under Q140849

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 additional information, click the following article number to view the article in the Microsoft Knowledge Base:

    139597 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 additional information about how to use Wizard TxtBtns in forms in Visual FoxPro, click the following article numbers to view the articles in the Microsoft Knowledge Base:

134704 How to add controls to a form generated by the Form Wizard

134790 How to add code to wizard-generated command buttons


Modification Type:MinorLast Reviewed:7/1/2004
Keywords:kbControl kbForms kbwizard kbcode kbhowto KB140849 kbAudDeveloper