Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to modify a form generated by a Wizard? 3

Status
Not open for further replies.

plepkowski

Programmer
Jul 22, 2005
17
US
I'm trying to use VFP 6 to bring an old Clipper .dbf into a real window application. I generated a form with the Wizard which has command buttons for navigation, find, print, add, edit, and exit.

1. Can I get rid of the Print button?

2. Can I make certain fields read only?

3. Can I insert (dtos(date())+time()) into a field upon adding or editing a record.

Paul Lepkowski
 
Paul: Here is a different approach:

First make a copy of your project and do this in the copy

This is in VFP9 and my suggestion says VFP9, so you will have to poke around in VFP6, years since I used VFP6, and I don’t have it installed, My guess is it’s the same. There is some work involved but this is better than people here trying to teach you VFP 101. No Offence Meant, beleave me we ALL went through this.

In windows explorer
Click C:\program Files\Visual FoxPro9\wizards
Locate Wizbtns.vcx AND Wizbtns.vct. If they are not named the same open some to see if the Add, Edit etc look the same as on your form.

Copy (BOTH) these files to your project
This class has all the controls you need for your forms and it wizard put one part of it on your form

In your project Manager in the Class Pane
Click “Add” and select “wizbtns.vcx” from where you copied it

In your startup program put this line:
Set classlib to <<path>>\wizbtns.vcx

Next:
Open your form again
Delete the whole container (all the buttons)

In Project manager click wizbtns to display a drill down
Drag “Txtbtns” on your form.

Cannot remember if you can drag in vfp6. If you cant, you will have to add the wizbtns class. In VFP click Tools->Options->Controls->add (somebody can correct me here). Next in Form Designer, in the toolbar click the View Class button and swith from standard to Wizbtns, by clickin it. This will display all the subclasses in the toolbar. Select Txtbtns and place on your form.

Save and Run your form. Hopefully you will not get any errors. If you do and cannot resolve them, delete your project and ask for help here.

1. Can I get rid of the Print button?

Now if you don’t want the Print button EVER , modify “ txtbtns” and delete the print button. But make sure you note down its name. Next open every method and property in “Txtbtns” class and delete every reference to the print button.
This will also give you an idea on how the buttons work. BUT Be Aware This is a drastic approach if you do not know what you are doing. Be careful.

2. Can I make certain fields read only?

2. Right click the field in design mode. In Properties locate ReadOnly and set it to .T.

3. Can I insert (dtos(date())+time()) into a field upon adding or editing a record.
3.Yes

Good Luck


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top