unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls;
type
TForm3 =
class(TForm)
TreeView1: TTreeView;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.FormCreate(Sender: TObject);
Var
i,j : Integer;
n : TTreeNode;
begin
for I := 0
to 20
do begin
n := TreeView1.Items.Add(
nil,IntToStr(i));
for j := 0
to 20
do
TreeView1.Items.AddChild(n,n.text+'
/'+intToStr(j));
end;
end;
procedure TForm3.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
n : TTreeNode;
begin
n := TreeView1.GetNodeAt(X,Y);
if n<>
nil then
label1.Caption := n.Text;
end;
end.