Object Naming Conventions
Follow this suggested format for naming objects.
PrefixName
Suggested prefixes for object names are listed in the following table.
Prefix | Object | Example |
---|---|---|
chk | CheckBox |
|
col | Collection |
|
cbo | ComboBox |
|
cmd | CommandButton |
|
cmg | CommandGroup |
|
cnt | Container |
|
ctl | Control |
|
cad | CursorAdapter |
|
<user-defined> | Custom |
|
dte | DataEnvironment |
|
edt | EditBox |
|
frm | Form |
|
frs | FormSet |
|
grd | Grid |
|
grc | Column |
|
grh | Header |
|
hpl | HyperLink |
|
img | Image |
|
lbl | Label |
|
lin | Line |
|
lst | ListBox |
|
olb | OLEBoundControl |
|
ole | OLE |
|
opt | OptionButton |
|
opg | OptionGroup |
|
pag | Page |
|
pgf | PageFrame |
|
prj | ProjectHook |
|
sep | Separator |
|
shp | Shape |
|
spn | Spinner |
|
txt | TextBox |
|
tmr | Timer |
|
tbr | ToolBar |
|
xad | XMLAdapter |
|
xfd | XMLField |
|
xtb | XMLTable |
|
Remarks
Prefixes aren't required, but are recommended as good programming practice. Using a prefix does not dictate the contents of an object variable — in Visual FoxPro, prefixes are used only as a naming convention. For example, adding the prefix "cbo" does not check that the object referenced by the variable is a combo box, but it does help you remember the object referenced by the variable.
For more information, see Visual FoxPro Naming Rules.
See Also
Constant Naming Conventions | Table Field Naming Conventions | Variable Naming Conventions | Visual FoxPro Naming Rules | Window Naming Conventions