Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Object Naming Schemes
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Object Naming Schemes
■ Visual Basic makes it easy to create applications by providing a default
naming scheme, such as Form1, Form2, Combo1, and Combo2.
See: ◄Default Control Names►
■ In larger applications, however, default form and control names are often
too generic to be useful. For example, if you have several projects
containing a form named "Form1," that form will be overwritten in all
projects unless you give it a unique name. It's a good idea to devise a
simple naming scheme for your objects to make your code more readable.
■ You might consider using the following formula:
typeDescription
where type is a three-letter abbreviation indicating the type of control,
and Description indicates the particular use or action of the control.
For example, a text box that displays a digital readout might be named:
txtDigits
■ Using this formula, consider adopting the following three-letter
abbreviations for your naming scheme:
Object Abbreviation Object Abbreviation
═════════════════════ ════════════ ══════════════ ═══════════════
Form frm Check box chk
Combo box cbo Command button cmd
Directory list box dir Drive list box drv
File List box fil Frame fra
Horizontal scroll bar hsb Label lbl
List box lst Menu mnu
Option button opt Picture box pic
Text box txt Timer tmr
Vertical scroll bar vsb
────────────────────────────────────────────────────────────────────────