Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Methods not copying over to new form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00518648
Message ID:
00518687
Views:
9
>Hello,
>
>I have a form that I created in which the controls have some minor methods behind them. For instance in the forms Init() method I have the following code:
>
>ThisForm.dRptDate.DateTextbox.value = Date() + (7-Dow(Date()))

Does your first form have a pageframe? Did you create a pageframe with the same name on the second form too?

BTW, you can assign values directly in Property sheet, just preceed it with =.

>
>The form accurately displays next Saturdays' date when the form initializes. I then created a second form, copied the date textbox from the first form, pasted it to the second form, and copied the code above into the new forms' Init() method. The new form's date textbox does not pull up any date when the form initializes.
>
>I have had a similar problem with the cancel button. Here is the code behind the click method:
>
>lCancelReport = .T.
>ThisForm.Release()
>
>This closes the first form, but does nothing with the second.
>
>I have mirrored the the attributes of both the forms and the controls, but the second form still does not work.
>
>Does VFP not allow you to copy controls from one form to another when THISFORM.xxx is used in the code?
>

It allows.

>Any help would be greatly appreciated!

You can save your first form as a class, and create the second as subclass of it.

Or you can just save the second form using Save as option on the first form. This way you would have the exact copy of the first form under different name. Then you can modify it to your desire.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform