OV .NET and BCB Pages

Home, news
VCL components
.NET components
Applications
Me
Contact

 

TMemoForm - template form of common use for C++ Builder (3-2009)

TMemoForm is template form of common use. Practically all resizable forms of my applications are derived from it.

It has following features:

  • when closed saves in ini-file form state, size and position (in overwritten BeforeDestruction method) and restores them when creating form (in overwritten AfterConstruction method). Size and position may be automatically corrected to fit the form in the screen);
  • has two virtual methods:

    virtual void __fastcall WriteToIni(TIniFile * IniFile) { }
    virtual void __fastcall ReadFromIni(TIniFile * IniFile) { }

    which are called in BeforeDestruction and AfterConstruction accordingly. These functions in TMemoForm did nothing; you can overwrite them in descendant forms to save/restore your form data in ini-file.
  • if the form has no icon assigned, application icon will be assigned to the form.

Ini-file above is located in application settings folder
(Documents and Settings\user\Application Data\CompanyFolder\ApplicationFolder\application-exe-name.ini.
CompanyFolder and ApplicationFolder may be set in advance, for example, in WinMain:

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	try
	{
		Ov::AppFolder.CompanyFolderName = _T("OV");
		Ov::AppFolder.AppFolderName = _T("OV Printing Pack Demo");

You can place TMemoForm in Object repository. But I use to store all my template forms in separate folder, include them in projects directly and then inherit from them.

Please keep property OldCreateOrder = false.

Freeware with source code

Download

Back to VCL components