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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.