Even the birds know that Delphi is a great tool when custom component creation is in question.
Experienced Delphi developers, when they need a "non-existing" control (exposing some specific functionality), would either look for a third-party VCL solution or would try creating a new control from scratch.
What most beginners do not know is that they *can* create their own custom controls derived from the existing VCL set, by using component templates.
Let's consider the TPanel Delphi control - you use it to put an empty panel on a form - then drop other controls on it. Thus, a panel is mostly used as a container control.
When you drop a Panel on a form, it will, by design, have a default Caption set to something like "Panel1". I myself, in 99.99% cases, have to clear out the caption before adding any controls to it - I simply do not need a caption on a panel.
Therefore, here's how to "fake" creating your own Panel control that has an empty caption by design.
Captionless PanelHere's what to do:
- Have an empty Delphi form,
- Drop a TPanel on it. It will have "Panel1" for its Caption,
- Clear out the caption property in the Object inspector,
- Change any any other properties as needed - to "default" values for your panel,
- Select Component - Create Component Template. The "Create Component Template" will be displayed.
- Specify the name for your custom "fake" control. Default will be "TPanelTemplate". Specify the palette page. Click ok.
- Locate the "Templates" palette on the tool palette. There's a new "TPanelTemplate" component.
- Drop it on a form - note that there's no caption!