INFO: Object Hungarian Notation Naming Conventions for VB

This article was previously published under Q173738
This article has been archived. It is offered "as is" and will no longer be updated.
This is a list of Visual Basic control and object prefixes provided as areference for consistent use of Hungarian Notation. This list will assistin standardizing the structure, coding style and logic of an application.
Object                             Prefix                Example--------------------------------------------------------------------------Form                               frm                   frmFileOpenCheck box                          chk                   ReadOnlyCombo box                          cbo                   cboEnglishData-bound combo box               dbc                   dbcEnglishCommand button                     cmd                   cmdCancelData                               dat                   datBiblioDirectory list box                 dir                   dirSourceDrive list box                     drv                   drvTargetFile list box                      fil                   filSourceFrame                              fra                   fraLanguageGrid                               grd                   grdPricesData-bound grid                    dbg                   dbgPricesHorizontal scroll bar              hsb                   hsbVolumeImage                              img                   imgIconLabel                              lbl                   lblHelpMessageLine                               lin                   linVerticalList box                            lst                  lstPolicyCodesData-bound list box                dbl                   dblPolicyCodeMenu                               mnu                   mnuFileOpenOLE container                      ole                   oleObject1Option button                      opt                   optFrenchPicture box                        pic                   picDiskSpaceShape                              shp                   shpCircleText box                           txt                   txtGetTextTimer                              tmr                   tmrAlarmObject                             Prefix                Example------------------------------------------------------------------------Vertical scroll bar                vsb                   vsbRateAnimation button                   ani                   aniMailBoxbed      Pen                       Bedit                 bedFirstNameCheckbox                           chk                   chkReadOnlyPicture clip                       clp                   clpToolbarCommunications                     com                   comFaxControl                            ctl                   ctrCurrentData control                       dat                   datBiblioDirectoryDirectory list box                 dir                   dirSourceCommon dialog ctrl                 dlg                   dlgFileOpenDrive list box                     drv                   drvTargetFile list box                      fil                   filSourceForm                               frm                   frmEntryFrame (3d)                         fra                   fraStyleGauge                              gau                   gauStatusGroup push button                  gpb                   gpbChannelGraph                              gra                   graRevenueGrid                               grd                   grdPricesPen Hedit                          hed                   hedSignatureHorizontalscrollbar                hsb                   hsbVolumeImage                              img                   imgIconPen Ink                            ink                   inkMapKeyboard key status                key                   keyCapsLabel                              lbl                   lblHelpMessageLine                               lin                   linVerticalMDI child form                     mdi                   mdiNoteMAPI message                       mpm                   mpmSentMessageMAPI session                       mps                   mpsSessionMCI                                mci                   mciVideoMenu                               mnu                   mnuFileOpenObject                             obj                   objUserTableOption Button (3d)                 opt                   optRedOutline control                    out                   outOrgChart3d Panel                           pnl (3d)              pnlTitleListReport control                     rpt                   rptQtr1EarningsShape controls                     shp                   shpCircleSpin control                       spn                   spnPagesTimer                              tmr                   tmrAlarmVertical scroll bar                vsb                   vsbRateDatabase Objects                   Prefix                Example--------------------------------------------------------------------------ODBC Database                      db                    dbAccountsODBC Dynaset object                dyn                   dynSalesByRegionField collection                   fld                   fldCustomerField object                       fld                   fldAddressForm                               frm                   frmNewUserIndex object                       idx                   idxAgeIndex collection                   idx                   idxNewAgeMacro                              mcr                   mcrCollectUsersQueryDef object                    qry                   qrySalesByRegionQuery                              qry                   qrySalesByRegionReport                             rpt                   rptAnnualSalesSnapshot object                    snp                   snpForecastTable object                       tbl                   tblCustomerTableDef object                    tbd                   tbdCustomers				

The following table lists standard third-party vendor name prefixcharacters to be used with control prefixes:
Vendor                         Abbreviation-------------------------------------------MicroHelp (VBTools)            mPioneer Software Q+E Database  pCrescent Software              cSheridan Software              sOther (miscellaneous)          oObjects                            Prefix                Example---------------------------------------------------------------------Alarm(Microhelp)                   almm                  almmAlarmAnimate(Microhelp)                 anim                  animAnimateCallback(Microhelp)                calm                  callbackCombo Box(Pioneer)                 cbop                  cbopComboBoxCombo Box(Sheridan)                cbos                  cbosComboBoxDB_Check(Pioneer)                  chkp                  chkpCheckBoxchart(Microhelp)                   tm                    tmChartClock(Microhelp)                   clkm                  clkmClockCommand Button(Microhelp)          cmdm                  cmdmCommandButtonDB_Command(Pioneer)                cmdp                  cmdpCommandButtonCommand Button(Group)(Microhelp)   cmgm                  cmgmBttonCommand Button (icon) (Microhelp)  cmim                  cmimCommandButtonCardDeck(Microhelp)                crdm                  crdmCardDice(Microhelp)                    dicm                  dicmDiceSSDir(Sheridan)                    dirs                  dirsDirListSSDrive(Sheridan)                  drvs                  drvsDriveListFile List(Microhelp)               film                  filmFileListSSFile(Sheridan)                   fils                  filsFileListFlip(Microhelp)                    flpm                  flpmButtonForm Scroll(Microhelp)             fsrm                  fsrmFormScrollGauge(Microhelp)                   gagm                  gagmGaugeGraph(Other)                       gpho                  gphoGraphQ_Grid(Pioneer)                    grdp                  grdpGridHorizontal Scroll Bar(Microhelp)   hsbm                   hsbmScrollDB_Hscroll(Pioneer)                hsbp                   hsbpScrollHisto(Microhelp)                   hstm                   hstmHistographInvisible(Microhelp)               invm                   invmInvisibleIcon Tag(Microhelp)                itgm                   itgmListBoxKey State(Microhelp                kstm                   kstmKeyStateLabel (3d) (Microhelp)             lblm                   lblmLabelLine(Microhelp)                    linm                   linmLineDB_List(Pioneer)                   lstp                   lstpListBoxSSList(Sheridan)                   lsts                   lstsListBoxMDI Control(Microhelp)             mdcm                   mdcmMDIChildSSMenu(Sheridan)                   mnus                   mnusMenuMarque(Microhelp)                  mrqm                   mrqmMarqueOddPic(Microhelp)                  odpm                   odpmPicturePicture(Microhelp)                 picm                   picmPictureDB_Picture(Pioneer)                picp                   picpPictureProperty Vwr(Microhelp)            pvrm                   vrmPropertyViewerDB_RadioGroup(Group)(Pioneer)      radp                   radqRadioGroupSlider(Microhelp)                  sldm                   sldmSliderSpinner(Microhelp)                 spnm                   spnmSpinnerSpreadsheet(Microhelp)             sprm                   sprmSpreadsheetStretcher(Microhelp)               strm                   strmStretcherScreen Saver(Microhelp)            svrm                   svrmSaverSwitcher(Microhelp)                swtm                   swtmSwitcherTag(Microhelp)                     tagm                   tagmListBoxTimer(Microhelp)                   tmrm                   tmrmTimerToolBar(Microhelp)                 tolm                   tolmToolBarTree(Microhelp)                    trem                   tremTreeInput(Microhelp) (Text)            txtm                   inpmTextDB_Text(Microhelp)                 txtp                   txtpTextVertical Scroll Bar(Microhelp)     vsbm                   vsbmScrollDB_VScroll(Pioneer)                vsbp                   vsbpScroll				
The base list can also be found in the Programmers Guide under the ObjectNaming Conventions Section.
kbVBp500 kbVBp600 kbdse kbDSupport kbVBp

Article ID: 173738 - Last Review: 12/04/2015 17:49:46 - Revision: 4.0

Microsoft Visual Basic 6.0 Learning Edition, Microsoft Visual Basic 6.0 Professional Edition, Microsoft Visual Basic 6.0 Enterprise Edition, Microsoft Visual Basic 4.0 Standard Edition, Microsoft Visual Basic 4.0 Professional Edition, Microsoft Visual Basic 4.0 Professional Edition, Microsoft Visual Basic 4.0 16-bit Enterprise Edition, Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

  • kbnosurvey kbarchive kbinfo KB173738