unit HeaderListe;
interface
uses
SysUtils, Classes, Controls, StdCtrls, Types, Windows, Graphics, ComCtrls;
type
THeaderListBox =
class(TListBox)
private
{ Private-Deklarationen }
FHeaderControl : THeaderControl;
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
constructor Create(AOwner:TComponent);
override;
destructor Destroy;
override;
published
{ Published-Deklarationen }
end;
{ ---------------------------------------------------------------------------- }
procedure Register;
{ ---------------------------------------------------------------------------- }
implementation
{ ---------------------------------------------------------------------------- }
procedure Register;
begin
RegisterComponents('
Test', [THeaderListBox]);
end;
{ ---------------------------------------------------------------------------- }
{ THeaderListBox }
{ ---------------------------------------------------------------------------- }
constructor THeaderListBox.Create(AOwner: TComponent);
var
HS: THeaderSection;
begin
inherited Create(AOwner);
FHeaderControl := THeaderControl.Create(AOwner);
Self.Left := 248;
Self.Width := 249;
Self.Height := 185;
Self.Top := 36;
Self.Style := lbOwnerDrawFixed;
FHeaderControl.Left := 248;
FHeaderControl.Width := 249;
FHeaderControl.Height := 22;
FHeaderControl.Top := 15;
FHeaderControl.Parent := Self;
FHeaderControl.Align := alCustom;
FHeaderControl.Style := hsButtons;
FHeaderControl.Show;
with FHeaderControl
do
begin
HS := Sections.Add;
HS.Text := '
Item1';
HS.Width := Width
div 2;
HS := Sections.Add;
HS.Text := '
Item2';
HS.Width := Width
div 2;
end;
end;
{ ---------------------------------------------------------------------------- }
destructor THeaderListBox.Destroy;
begin
inherited;
end;
{ ---------------------------------------------------------------------------- }
end.