Wednesday, June 18, 2008

Object Prefixes

Object Prefixes

In VB6 you can name objects however you want as long as the names contain no spaces or punctuation and are 40 characters or less. This does not mean you should name objects randomly, though. Consistent prefixes help you to find and identify objects. The following table shows the recommended prefixes.
Object Prefix Example
Combo Box cbo cboBonus
Check Box chk chkYourReality
Command Button cmd cmdPerformance
Data dat datUra
Directory List Box dir dirHome
Drive List BoxdrvdrvSafely
File List BoxfilfilRoom
FramefrafraPictures
FormfrmfrmIncidentReport
GridgrdgrdLock
Horizontal Scroll BarhsbhsbLongName
ImageimgimgCapture
LabellbllblNameTag
LinelinlinWalk
List BoxlstlstCharges
MenumnumnuValue
OLE clientoleoleCafe
Radio Button/ Option ButtonoptoptCheapTickets
Picture BoxpicpicFamily
ShapeshpshpPreschool(circle, square, oval, rectangle, rounded rectangle, and rounded square)
TimertmrtmrRound
Text BoxtxttxtVaticanus
Vertical Scroll BarvsbvsbThousandPardons

No comments: