Other Object Prefixes

Prefixes aren’t just for variables. All standard objects (including forms and controls) have a three-character prefix, as described in Tables 3-3, 3-4, and 3-5. Learn and use these prefixes consistently—if you’re not already. Correctly applying the standard three-character prefixes to all your variables and objects makes your code more self-documenting and easier to maintain.

Table 3-3. Prefixes for Standard Controls 
Control Prefix Example
Check box chk chkPrint
Checked list box chklst chklstLunchItems
Combo box cbo cboTitle
Context menu ctx ctxContactsMenu
Control (generic) ctl ctlCurrentControl
Data grid grd grdOpenTasks
Domain up down dom domPrimaryDomain
Button btn or cmd btnOK; also acceptable ...

Get Practical Standards for Microsoft® Visual Basic® .NET, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.