Object Naming Conventions

See Also

Follow this suggested format for naming objects.

Syntax

PrefixName

Suggested prefixes for object names are listed in the following table.

Prefix Object Example
acd ActiveDoc
acdHomePage
chk CheckBox
chkReadOnly
cbo ComboBox
cboEnglish
cmd CommandButton
cmdCancel
cmg CommandGroup
cmgChoices
cnt Container
cntMoverList
ctl Control
ctlFileList
<user-defined> Custom
user-defined
edt EditBox
edtTextArea
frm Form
frmFileOpen
frs FormSet
frsDataEntry
grd Grid
grdPrices
grc Column
grcCurrentPrice
grh Header
grhTotalInventory
hpl HyperLink
hplHomeURL
img Image
imgIcon
lbl Label
lblHelpMessage
lin Line
linVertical
lst ListBox
lstPolicyCodes
olb OLEBoundControl
olbObject1
ole OLE
oleObject1
opt OptionButton
optFrench
opg OptionGroup
opgType
pag Page
pagDataUpdate
pgf PageFrame
pgfLeft
prj ProjectHook
prjBuildAll
sep Separator
sepToolSection1
shp Shape
shpCircle
spn Spinner
spnValues
txt TextBox
txtGetText
tmr Timer
tmrAlarm
tbr ToolBar
tbrEditReport

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.