Search Tools Links Login

Standard Prefixes (For all Beginners, Intermediate, and Advanced)


When naming a control, it is recomended that you start the name with a three-letter prefix that helps you identify what kind of control you are referencing. For example, a form should be called frm1 instead of Form1. Also I've included one piece of code that everyone should include in their projects.

Original Author: Ravage

Code






New Page 1


Here are some standard prefixes for commonly used controls.

Prefix:   Control:

ani     Animation button

cbo     Combo box

ch3     3D Check box

chk     Check box

clp     Picture clip

cm3     3D Command button

cmd     Command Button

ctr     Control (specific type unknown)

dat     Data

dir     Directory list box

dig     Common dialog box

drv     Drive list box

fil     File list box

fr3     3D Frame

fra     Frame

frm     Form

gpb     Group push button

gra     Graph

grd     Grid

hsb     Horizontal scroll bar

img     Image

ils     Image list

lbl     Label

lin     Line

lst     List box

mci     Multimedia MCI

mnu     Menu

opt     Option button

pic     Picture box

prg     Progress bar

shp     Shape

sli     Slider

spn     Spin button

tlb     Toolbar

tmr     Timer

tre     Tree view

txt     Text box

vtb     Vertical scroll bar



Also remember to include "Option Explicit" w/out the quotation marks in your declarations. This small piece of code requires that a variable's name be declared before they are used in code. VERY IMPORTANT. Remember to add this to all of your projects, because it will help you in so many ways! Another way to include Option Explicit in your program is to select Tools | Options from the menu bar. Under the Editor tab, one of the settings is Require Variable Declaration. When selected, any new module automatically has Option Explicit in its General Declarations section.




About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 75 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.