access与VB编程–控件及变量命名规则

时间:16-11-17 栏目:网站&编程, 网络&技术 作者:wukong 评论:0 点击: 192 次

摘 要:Access及VB编程控件及变量命名规则
正 文:

    经常使用Access的朋友,要是不规范命名规则,很容易自己搞混淆;

本文转载介绍了一下VB命名规则,由于Access跟vb基本语法类似,这里就整理成技巧供初学者查看:

Access及VB编程控件及变量命名规则

 

 

一、常用控件的命名:

控件类型                                前缀                         例子
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

声明: 本文由( wukong )原创编译,转载请保留链接: access与VB编程–控件及变量命名规则

access与VB编程–控件及变量命名规则:等您坐沙发呢!

发表评论

您必须 [ 登录 ] 才能发表留言!

------====== 本站公告 ======------
大家有任何疑问和建议,请到这里留言:点击留言板

读者排行