The closest VB comes to accomplishing the inheritance you are seeking is with the Implements keyword. Like Christian said, you can create a template form, save it in a known location, and make a copy of it each time you want to use that form.
However, if you only need to implement the same properties and methods in each new instance of your form, create a class with the definitions of the properties and methods (lets call it CTemplate), then type "Implements CTemplate" on a line by itself at the top of your new form's code.
After you insert the "Implements" keyword, "CTemplate" will appear in the objects drop-down list of your form's code window. Likewise, selecting "CTemplate" in the object list will populate the property/method drop-down list with the names of all properties and methods defined in the CTemplate class module.
Take note, though, that you can only create a "shell" for the properties and methods in your template class. It is not a "base class" in the same sense as it would be in VFP and C++ - you can't inherit code from it. (It is, however, somewhat polymorphic in that you can define properties/methods in the template "as Object," but I won't go into that right now.)
Another thing to point out: a form, albeit a special type of class module, cannot be used as a base class for another form. In other words, you can't say "Implements Form1" in the code for Form2.
Hope this helps.
Previous
Next
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