Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Custom

This base class is the building block for non-visual objects. It’s similar to the Container class, except that it can’t be seen. Like the other classes that are meant primarily as building blocks (Container and Control), Custom’s name is somewhat overloaded. We’ll use capital “C” when we mean the class.

Subclass Custom for most classes that don’t need to appear on a form (though Timer, ActiveDoc and HyperLink are better when you need their specific abilities). Although Custom-based classes have no visual appearance, you can and should build them in the Class Designer rather than in code.

Custom has only a few PEMs, the ones that are shared by every class like Name, Class, Init and Destroy, and the ones that all containers have, like AddObject and RemoveObject.

If you don’t need the container capabilities of this class, but are just using it as a convenient place to hang a few custom methods and properties, consider using some of the other base classes. Several are even simpler and may consume fewer resources than Custom. One area where this is especially true is instantiation time, if you need a slew of them. Contributor Steven Black has suggested Line and Relation as “ultralightweight” classes.

Property

Value

Purpose

Picture

Character

A picture used to represent the class in the Form and Class Designers.

Example

* See SQLConnect() for a class based on Custom

See Also

Container, Control, SQLConnect()