一、常用控件的命名:
控件類型 字首 例子
Form frm frmMain
Menu mnu mnuFileOpen
Label lbl lblHelpMessage
Check box chk chkReadOnly
Combo box cbo cboEnglish
Command button cmd cmdExit
Common dialog dlg dlgFileOpen
Data grid dgd dgdTitles
Date picker dtp dtpPublished
Directory list box dir dirSource
Drive list box drv drvTarget
File list box fil filSource
ADO Data ado adoBiblio
Frame fra fraLanguage
Hierarchical flexgrid flex flexOrders
Image img imgIcon
ImageList ils ilsAllIcons
List box lst lstPolicyCodes
ListView lvw lvwHeadings
Month view mvw mvwPeriod
MS Chart ch chSalesbyRegion
MS Flex grid msg msgClients
MS Tab mst mstFirst
OLE container ole oleWorksheet
Option button opt optGender
Picture box pic picVGA
ProgressBar prg prgLoadFile
RichTextBox rtf rtfReport
StatusBar sta staDateTime
TabStrip tab tabOptions
Text box txt txtLastName
Toolbar tlb tlbActions
TreeView tre treOrganization
二、變量命名
資料類型 字首 例子
String (字元串類型) str strFName
Integer (短整數類型) int intQuantity
Long (長整數類型) lng lngDistance
Single (單精度浮點數類型) sng sngAverage
Double (雙精度浮點數類型) dbl dblTolerance
Boolean (布爾類型) bln blnFound
Byte (位元組類型) byt bytRasterData
Date (日期類型) dte dteNow
Currency (貨币計算與定點計算類型) cur curRevenue
Object (東西類型) obj objCurrent
Variant (變體類型) vnt vntCheckSum