home *** CD-ROM | disk | FTP | other *** search
- unit NewComp;
- {
- This a form that has been converted into a component.
- You can still edit in the form designer as if it were a
- form.
-
- Make sure that its DFM file does not include the
- following lines:
-
- PixelsPerInch = 96
- TextHeight = 16
-
- To get rid of them, you need to translate the DFM file
- to text, and then delete them, then translate the file
- back into a DFM file. Do it either in the editor, or
- else use the CONVERT.EXE command line utility.
-
- Inside the DFM file, give the main object its own name:
-
- object Form2: TForm2
- Left = 15
- Top = 22
- Width = 435
- Height = 300
- Caption = 'Form2'
- Font.Color = clWindowText
- Font.Height = -13
- Font.Name = 'System'
- Font.Style = []
- object SpeedButton1: TSpeedButton
- Left = 168
- Top = 96
- Width = 25
- Height = 25
- end
- object BitBtn1: TBitBtn
- Left = 32
- Top = 24
- Width = 89
- Height = 33
- Caption = 'BitBtn1'
- TabOrder = 0
- end
- object BitBtn2: TBitBtn
- Left = 136
- Top = 24
- Width = 89
- Height = 33
- Caption = 'BitBtn2'
- TabOrder = 1
- end
- end
-
-
- }
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs,
- Messages, Classes, Graphics,
- Controls, Forms, Dialogs,
- StdCtrls, Buttons, ExtCtrls;
-
- type
- TForm2 = class(TPanel)
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- SpeedButton1: TSpeedButton;
- private
- { Private declarations }
- public
- Constructor Create(AOwner: TComponent); override;
- { Public declarations }
- end;
-
- var
- Form2: TForm2;
-
- procedure Register;
-
- implementation
-
- {$R *.DFM}
-
- procedure Register;
- begin
- RegisterComponents('Unleash', [TForm2]);
- end;
-
- constructor TForm2.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- IsControl := True;
- ReadComponentRes(ClassName, Self);
- end;
-
- end.
-