home *** CD-ROM | disk | FTP | other *** search
- unit Main;
-
- { Program copyright (c) 1995 by Charles Calvert }
- { Project Name: HEADER1 }
-
- { A simple example of using the Header Component.
- Run the program, and use the mouse to grab the
- line between the words Left and Right at the
- top of the program. Now move the line back and
- forth to the right and left. }
-
- interface
-
- uses
- WinTypes, WinProcs, Classes,
- Graphics, Forms, Controls,
- ExtCtrls, StdCtrls, SysUtils;
-
- type
- TForm1 = class(TForm)
- ListBox1: TListBox;
- ListBox2: TListBox;
- Header1: THeader;
- procedure Header1Sized(Sender: TObject; ASection, AWidth: Integer);
- procedure FormCreate(Sender: TObject);
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.Header1Sized(Sender: TObject; ASection, AWidth: Integer);
- begin
- ListBox1.Width := Header1.SectionWidth[0] + 2;
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- var
- i: Integer;
- begin
- ListBox1.Width := Header1.SectionWidth[0] + 2;
- for i := 0 to 75 do begin
- ListBox1.Items.Add('ListBox1 => ' + IntToStr(i));
- ListBox2.Items.Add('ListBox2 => ' + IntToStr(i));
- end;
- end;
-
- end.
-
-