Board index » delphi » TCustomForms only

TCustomForms only

Hi,

I'd like to build an application using a number of similarly looking and behaving forms.
So before creating the application itself, I'd like to create a base form, derived from
TCustomForm, and use it as template for all other forms. At creation time, this form
should already contain a background image, message handlers, and so on.

Is it possible to create such a template and add it to the File->New dialog, or even make
Delphi use only this form as template ?

Since TApplication.MainForm is of type TForm, is it possible to create an application
without a single TForm descendent, or must there be at least one ?

Rollie Tyler

 

Re:TCustomForms only


Hi,

Quote
>Hi,

>I'd like to build an application using a number of similarly looking and
behaving forms.
>So before creating the application itself, I'd like to create a base form,
derived from
>TCustomForm, and use it as template for all other forms. At creation time,
this form
>should already contain a background image, message handlers, and so on.

>Is it possible to create such a template and add it to the File->New

dialog, or even make

Quote
>Delphi use only this form as template ?

Yes. After you set up your base form, save it as a template. It will be
saved to the repository and will be available in the File->New dialog under
Forms or any other tab you choose.

Quote
>Since TApplication.MainForm is of type TForm, is it possible to create an
application
>without a single TForm descendent, or must there be at least one ?

The form you derived and saved to the repository IS a TForm descendant.
After you start a new application, simply add another form of
'TDerivedForm' type to it (using the File->New dialog), and delete the
original TForm form Delphi added. You can even choose to inherit from your
TDerivedForm, so that changes made to the form saved in the repository will
be propagated to all the forms of that type in your apps next time you
build them.

Humberto Jemma (Brazil)

-------------------------------
Message Posted by  <dedGateway>
http://www.dedonline.com/forumb

Re:TCustomForms only


Thank you very much !!!!!

One more question: I'd like to inherit from TCustomForm instead of TForm, because I want
several properties (like BorderStyle, AutoScroll etc.) not to be available for my
template. Is that possible ?

Rollie

Other Threads