VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



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

by Ravage (3 Submissions)
Category: Coding Standards
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

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.

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






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.




Download this snippet    Add to My Saved Code

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

No comments have been posted about Standard Prefixes (For all Beginners, Intermediate, and Advanced). Why not be the first to post a comment about Standard Prefixes (For all Beginners, Intermediate, and Advanced).

Post your comment

Subject:
Message:
0/1000 characters