Visual Basic Programming Standards

 

The Visual Basic Programming Standards from the Operations Research Department at Naval Postgraduate School (NPS) have been adapted here as a guideline.

Documentation in the Source Code

Object Type Naming Convention
Form FRM
Command Button / 3D Command  Button CMD
List Box LST
Combo Box CMB
Text Box TXT
Picture Box PIC
Label / 3D Label LBL
Grid Control GRD
Graph Control GRPH
Option Button / 3D Option Button OPT
Check Box / 3D Check Box CHK
File List Box FIL
Directory List Box DIR
Class CLS
Drive List Box DRV

 

Software Engineering Standards

 

User Interface

Error Prevention

Indentation and Blocks

     

 

Repetition

Visual Basic has three repetition constructs: the Do While-Loop. the Do-Loop Until, and the For-Next loop. For some repetition situations in a program, there is only one possible repetition construct that can be used. In most situations there is a choice. Each repetition construct was designed for a specific situation: therefore, it is possible to develop standards that will dictate the appropriate repetition to use in most programming situations. The following guidelines almost always dictate the appropriate choice: