Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > 综合其它

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

时 间:2011-10-21 21:20:21
作 者:等待虫   ID:5323  城市:沈阳
摘 要: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



Access软件网官方交流QQ群 (群号:54525238)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助