The Subclassing of Objects
You can create custom objects by subclassing the base classes provided with Visual FoxPro. For example, the following code subclasses the Outline control provided with Visual FoxPro:
Subclassing the Outline Control
Code | Comments |
---|---|
|
Declare variables and initialize. |
|
Create a form, add the custom outline control to the form, and then create an array for the items that the control lists. |
|
Prompt for a database that contains the information you want the control to list. |
|
Gather information from the database, and then add it to the control. |
|
Make the control visible, and then display the form. |
|
Define a subclass of the OLE Container control and add the outline control by setting the OleClass property of the container, and then defining other custom settings. |
If you want to distribute your applications, there are some additional considerations.
See Also
Manipulation of Objects with Automation | The Control of Visual FoxPro from Other Applications | Adding OLE | Using Remote Automation | Using ActiveX Controls