About The Variable Naming Tutorial
There are a lot of programmers that don't properly indicate what type of variable they are using. The best way to make your code understandable for
others and yourself is to properly preceed your variables and objects with an easy to understand prefix.
As a general rule (not always applied) it is best to prefix variables with a single letter, and prefix objects with three letters. Just follow the chart
below.
This list is not an official prefix list. It's only a suggestion list using naming conventions I was taught, as well as a few official Microsoft naming
conventions.
Variable Prefixes
Prefix | Variable Type |
b | Boolean |
c | Currency |
d | Double |
f | Single |
i | Integer |
l | Long |
r | Short |
s | String |
t | Date or Time |
v | Variant |
y | Byte |
Object Type
Prefix | Object Type |
btn | Button |
cal | Calendar |
cbo | ComboBox |
chk | CheckBox |
cmd | Command Button |
dir | Directory ListBox |
dlg | Common Dialog Box |
drv | Drive Selector |
dtp | Date Picker |
fil | File ListBox |
fra | Frame |
frm | Form |
ilt | ImageList |
img | Image |
lbl | Label |
lst | ListBox |
lvw | ListView |
mnu | Menu Item |
nud | NumericUpDown |
obj | Object |
opt | Radio (Option) Button |
pic | Picture Box |
prg | Progress Bar |
sbr | StringBuilder |
tkb | TrackBar |
tmr | Timer Control |
txt | TextBox |