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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there utiltity to compare properties of forms

Status
Not open for further replies.

vfpgolfer

Programmer
Oct 16, 2004
76
US
I want to compare properties on a few forms so I can add methods from one form to another without having to worry about missing properties on the second form
 
I want to compare properties on a few forms so I can add methods from one form to another without having to worry about missing properties on the second form

I guess my first question is, "Why are you copying properties and methods from one form to another instead of subclassing the form with the methods and properties you want?" The purpose of OOP is to not duplicate code. When you subclass a form, the subclass inherits all the properties and methods of the parent, so you are guaranteed that they are there.

pamela
 
second form already exists and needs "most" of the code from one of the methods
 
Hi,

wondering if it's form classes in a vcx or scx forms.

VCX:
if you have two forms and want to share methods, put these methods in a new form parent class and change the parent class of each form to this new class with the class browser. With right click on a class you can change it's parent.

If you transfer everything you want to be shared by both forms into that parent class form, you can be sure both forms have inherited these properties and methods.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top