KB02: Abbreviation of Components
BCB Component Prefixes & Naming Examples
This reference provides recommended prefixes and naming examples for common BCB (C++Builder VCL) components. The naming convention follows this format: <prefix><FunctionName>
Example: btnClose, lblStatus, edtUserName
1. Naming Rule
- Use a short lowercase prefix for the component type.
- Use PascalCase for the function name.
- Make the function name meaningful and descriptive.
- Avoid generic names such as Button1, Edit2, or Label3.
2. Prefix Table
| Component | Suggested Prefix | Example Name |
|---|---|---|
| TActionList | actlst | actlstMain |
| TActionManager | actmgr | actmgrMainMenu |
| TButton | btn | btnClose |
| TCheckBox | chk | chkEnableUwf |
| TCheckListBox | clb | clbOptions |
| TColorBox | clr | clrTheme |
| TComboBox | cmb | cmbModeSelect |
| TEdit | edt | edtUserName |
| TImage | img | imgPreview |
| TImageList | iml | imlToolbarIcons |
| TImageCollection | imgcol | imgcolTrayIcons |
| TVirtualImageList | vil | vilTrayIcons |
| TLabel | lbl | lblStatus |
| TListBox | lst | lstDevices |
| TMaskEdit | medt | medtDateInput |
| TMemo | mem | memLogOutput |
| TPageControl | pgc | pgcMainTabs |
| TPanel | pnl | pnlTopBar |
| TProgressBar | prg | prgOverlayUsage |
| TRadioButton | rad | radAutoMode |
| TRadioGroup | rgp | rgpModeSelect |
| TRichEdit | redit | reditReport |
| TScrollBox | scr | scrContentArea |
| TShape | shp | shpStatusIndicator |
| TSpeedButton | spdbtn | spdbtnRefresh |
| TTabControl | tab | tabSettings |
| TTaskBar | tskbar | tskbarMain |
| TTrayIcon | tray | trayUwf |
| TTimer | tmr | tmrTrayUpdate |
3. Recommended Naming Notes
- Use clear and meaningful names, such as btnSaveSettings or lblOverlayUsage.
- Keep all prefixes lowercase.
- Use PascalCase for the functional part of the name.
- Do not use generic names like Button1, Edit1, or Panel2.
4. Example Naming Set for a UWF Tray Monitor Project
| Component Type | Suggested Name |
|---|---|
| TImageCollection | imgcolTrayIcons |
| TVirtualImageList | vilTrayIcons |
| TTrayIcon | trayUwf |
| TTimer | tmrTrayUpdate |
| TLabel | lblUwfStatus |
| TProgressBar | prgOverlayUsage |
| TButton | btnRefreshStatus |
5. Summary
A consistent naming convention improves readability, maintenance, and teamwork. Using the format <prefix><FunctionName> makes BCB projects easier to organize, especially in medium and large VCL applications.