Unit Unit1;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls;
Type myPanel =
Class(TPanel)
PRIVATE
FTreeView: TTreeView;
PUBLIC
Constructor Create(AOwner: TComponent);
OVERRIDE;
End;
Type
TForm1 =
Class(TForm)
Procedure FormCreate(Sender: TObject);
PRIVATE
FMyPanel: myPanel;
PUBLIC
End;
Var
Form1: TForm1;
Implementation
{$R *.dfm}
Procedure TForm1.FormCreate(Sender: TObject);
Begin
FMyPanel := myPanel.Create(Self);
End;
{ myPanel }
Constructor myPanel.Create(AOwner: TComponent);
Begin
Inherited;
FTreeView := TTreeView.Create(Self);
FTreeView.Parent := Self;
FTreeView.Align := alClient;
FTreeView.Items.AddNode(
Nil,
Nil, '
test',
Nil, naAdd);
End;
End.