General information
Category:
Object Oriented Programming
For the reference to the child forms, you may want to call the method with a reference to the childform. Ex: ParentForm.MyMethod( Thisform )
Then you can get all objects, properties, etc of whatever the current THISFORM is.
As for changing the baseclass of a form, yes, you can change this.
Create a baseclass of the form and store in whatever class library you want. You may want to create a copy of all baseclasses and put into this library.
Then just USE the form.scx as if it was a standard .dbf file as that is all a form is. A table with records for each object and where it is based upon, etc.
Ex: USE MyFORM.SCX
Then browse this table
open the memo fields for "CLASS", "CLASSLOC", and "BASECLASS". When you get to the line that has BASECLASS = "FORM", just change the values of the CLASS to whatever the name of the form base class you created in your own class library. Ex: MyFormBase. Then change the value in CLASSLOC to the location that your class library exists. This should be relative directory position from where the form is. Ex: If you have a directory for all your forms in FORMS\ and all your custom classes in CLASSES\, you would want to set the classloc = "..\classes\myclasslib.vcx"
Close the table and run the form. Any changes you make to your new form base class will be reflected in any form using it.
>Hi All,
>
>I am putting in place multi-linguale functionality to an existing
>application. I created two recursive methods (SaveCaptions and
>SetCaptions) that are used to save and set the captions of a container and its sub-objetcs.
>
>These methods work fine when added to a form.
>
>Here is the problem:
>
>I am trying to call these methods from a child form but the methods being in the parent form, they cannot see the child form and its contained objects (I hope I am making sense...)
>
>Is there a way to make the child objects visible to the parent?
>Or a way to make these methods visible throughout the application?
>
>I cannot profit from inheritance since my application forms were based on the standard form class and not on a user-defined class (unless there is a way to change the baseclass of a form?)
>
>Anybody can help?
>
>Thanks in advance.
>
>P.Charbonneau
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only