Answer:
well... there's a very cool feature in Delphi that allows you to put togheter some Components (EVEN WITH THE CODE OF THE EVENTS!), so that you can reuse them all later with a single click, like dropping one component, but it will drop the group of components (TEMPLATE) in your form
here's how:
1 - In Delphi, start a new application
2 - Drop as many components as you want on the main form, and set their properties and/or events
3 - Select all the components that you want on your template
4 - Choose from the Delphi menu Component | Create Component Template
5 - Specify a name for your template , as a Delphi rule you may want to keep the "T" at the beginning of the name and change the rest to whatever you want
6 - Specify the Palette page where you want your new template to be, if you put a non existant palette page, Delphi will create a new one for you
7 - Delphi even lets you assign a new icon for your template
8 - Click OK
You're set!!
you just created a template which appears on the palette of components, and you can drop on a form as many times as you want and they will be linked (like if you chose a TTable linked to a TDatabase) as you specified, and will have all the code that you put on the events, all with a single click
Delphi is awesome, isn't?
Works on Delphi5, I don't know about earlier versions
salu2
EberSys
|