Copyright: CopyRight (C) 1996, ACSD


FRMPOS32 Unit

The following items are declared in the FRMPOS32 unit:

Components

TFormPosition

Types

TRegistryKey


TFormPosition Component
TFormPosition Component - UnRegisterd Version

Properties	Methods	Tasks

Unit

FRMPOS32

Description

The Tformposition components saves the position and size of the form that contains the component.

The information is stored in the registry in a key you specify in the key property under a root key specified with the rootkey property (Hkey_Current_User is the default). If the key does not exist the compent can create the key if the Createkey property is set to true.

The position and size of the form is saved as soon as the form is moved.


Using the TFormPosition Component

Purpose

Use the formposition component to have your application automatically save the position and size of the forms.  Each time your application runs the forms will be displayed in the position and size changed by the user.

Tasks

To Save the forms position set the saveposition property to true (the default)

Specifiy a key in the registry to save the forms information using the key property.

To load a form in it's designed position from within an application set the saveposition to false before displaying the form.


Properties

CreateKey	Name	Tag

DesignMode	RootKey	Key

SavePosition


CreateKey Property

Example

Applies To

TFormPosition

Declaration

Property CreateKey : Boolean;

Description

If createkey is set to true then the key specified in the key property is created if it does not exist.  If the value is false the component will attempt to open the key.


CreateKey Example

The following example turns on and off the creation of the key specified by setting createkey to true and false.

procedure TForm1.Button1Click(Sender: TObject);
begin
     If formposition1.createkey then
       formposition1.createkey := false
     else
       formposition1.createkey := True;
end;


DesignMode Property

Applies To

TFormPosition

Declaration

Property DesignMode : Boolean;

Description

The designmode property will load and save the current settings of the form's position and size while in the IDE editor.

The property should only be used at design time. Setting it at run-time has no affect on the program.

CAUTION:

If you set this property to true the form is moved to the position and size saved in the registry.  When you save the project in your IDE the forms new position and size will be stored with the project.

To get around this you can turn it on and see what it looks like in the IDE then do not save the changes to the project or form.


Key Property

Example

Applies To

TFormPosition

Declaration

Property Key : string;

Description

The key property specifies the key in the registry where the forms position and size information are stored.

This key will be created automatically if the createkey property is set to true.  The key will be created under the root key specified in the rootkey property the default is (Hkey_Current_User).


Key Example

The following example will have the forms position and size settings saved to "software\MyApp\Forms'.

procedure TForm1.Button1Click(Sender: TObject);
Begin
     FormPosition1.Key := 'software\MyApp\Forms';
end;


Name Property

Applies To

TFormPosition

Declaration

Property Name;

Description

The Name property is used internally by delphi as the name of the component. This component will be named formposition1 (only one component needed on a form). You may change this name to any name that does not conflict with any other component names on your form


RootKey Property

Example

Applies To

TFormPosition

Declaration

Property RootKey : TRegistryKey;

Description

The Rootkey property allows you to specify the rootkey used in the registry to create the key specified by the key property.

The following rootkeys can be used:

HKey_Current_User            ( This is the Default )
HKey_Classes_Root
HKey_Local_Machine
HKey_Users


RootKey Example

The following example sets the rootkey to HKey_Users.

procedure TForm1.Button1Click(Sender: TObject);
Begin
     FormPosition1.RootKey := HKey_Users;
end;


SavePosition Property

Example

Applies To

TFormPosition

Declaration

Property SavePosition : boolean;

Description

The SavePosition property allows you to turn on and off the saving of the form's position and size.

This can be used with a global setup option for your application so that all forms that contain the formposition component will either save their position and size or display at the designed position.


SavePosition Example

The following examples shows how to turn on and off the saving of the forms positions.

procedure TForm1.Button1Click(Sender: TObject);
Begin
     IF FormPosition1.SavePosition = true Then
       formPosition1.SavePosition := False
     Else
       formposition1.SavePosition := True;
end;


Tag Property

Applies To

TFormPosition

Declaration

Property Tag : integer;

Description

The tag property allows you a place to store a integer value with your applications.


Methods

SaveFormPosition


SaveFormPosition Method

Applies To

TFormPosition

Declaration

Procedure SaveFormPosition;

Description

The Saveformposition method allows your application to force a save of the form without the form being moved by a user.


TRegistryKey Type

Unit

FRMPOS32

Declaration

TRegistryKey = (Hkey_Classes_Root,HKey_Current_User,HKey_Local_Machine,HKey_Users);

Description

The TRegistryKey type defines the valid rootkeys that the tformposition component can use to store your application's form positions and sizes.


Registration

By Mail	Credit Card	Compuserve

Cost to Register TFormComponent is $15.00.

Registration Benefits

Registered users receive source code for both the 16 bit and 32 bit formposition components.
New help and kwf files without registration information.
Support via compuserve and(or) the Internet.
Information on new releases of this component (if any).
Bug fixes for the current version free of charge.
Information on new components and software released by ACSD.

Questions & Comments

If you have any questions, comments, or suggestions regarding this component please send a message or letter to one of the following addresses:

       Internet :   70254.637@CIS.COM

Compuserve :   70254,637

  Postal Mail :  Paul Shay
                       ACSD
                       799 Butler Road
                       Kittanning, PA 16201


Registration By Mail
To Register By Mail

Select "Print Topic" from the "File" menu to print this form.

TFormPosition Componet

$15.00 for 16 and 32 bit source Code.

PA - residents add 6% sales tax.

Please register my copy of TFormPosition - ,
I am sending a check or money order for $___________
(Check orders allow 2-4 weeks delivery)

Name:________________________________________________

Company:_____________________________________________

Address1:____________________________________________

Address2:____________________________________________

City:________________________________________________

State:_______________________________________________

Zip:_________________________________________________

Country:_____________________________________________

Phone:_______________________________________optional
Diskette Size:  _____ 5.25 inch  ____ 3.5 inch

Send completed form with payment to:

ACSD
Paul Shay
799 Butler Road
Kittanning, PA 16201


Registration By Credit Card
To Register With Credit Card

For your convenience we have contracted NorthStar Solutions to process any orders that you wish to place with your valid Visa or MasterCard. They may be contacted for orders only. Use any of the following methods to place an order:

Voice  :  1-800-699-6395 (10:00am - 10:00pm EST.  Calls from U.S. only)
             1-803-699-6395 (10:00am - 10:00pm EST.)

Fax     :  1-803-699-5465 (Available 24 Hours, International and business orders encouraged.)

E-mail :  America Online: STARMAIL     Compuserve:  71561,2751     Internet:  STARMAIL@AOL.COM

Regardless of how you register, please have the following information ready:

The program (TFORMPOSITION) and version number (1.0) you are registering.  Where the latest version should be mailed (e-mail will be used if provided).  Your Visa or MasterCard # and its expiration date.  Your drive types,  5.25 inch or 3.5 inch.  Your E-Mail address (so an E-Mail confirming your order can be sent and I (Paul Shay) can contact you easily with some important follow-up information).


Registration Via Compuserve
To Register Via Compuserve

If you have a Compuserve account, this is the fastest way to register

FormPosition 16 & 32 Bit Components      Version 1.0

GO SWREG and select #12648, the registration fee of $15.00 - will be billed to your Compuserve account.