Autor Beitrag
Fischman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Mo 30.08.04 14:13 
Hallo Leute,
ich habe da mal eine Frage.Wie komme ich an die das zweite und dritte Items ran.Mit dem ersten geht das ja.Und so mache ich es mit dem ersten oder geht das auch anders.

ausblenden Quelltext
1:
 if TreeView1.Selected=TreeView1.Items.Item[1] then					


Gruß Uwe
killavirus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 49

Win 2000
D5 Prof, D7 Prof
BeitragVerfasst: Mo 30.08.04 14:25 
Hi,

wenn du rausfinden willst welches Item in deinem Tree ausgewählt ist dann kannst du es über ne Schleife machen ...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  for x:=0 to TreeView.Items.Count-1 do begin
     if TreeView.Items[x].Selected = True then begin
         break;
     end;
  end;
vsti
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 43

XP Home
D2005
BeitragVerfasst: Mo 30.08.04 14:33 
hi

ka, ob das auch einfacher geht, aber ich hatte das mal so gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var node: TTreeNode;

...

node:=TreeView1.Items.AddChild(TreeView1.Items[0],'Child1');

...

if node.selected then ...


hilft nat nicht wenn du die items nicht zur laufzeit generierst...

greez, vsti

Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt.

_________________
[size=10:8b472be373]Wer anderen eine Grube gräbt hat Gold im Mund.[/size:8b472be373]
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Mo 30.08.04 15:27 
ich werde es dann Ausprobieren.

Gruß Uwe
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Mo 30.08.04 17:08 
So es hat sich erledigt.ich habe es so gemacht.

ausblenden Quelltext
1:
 if TreeView1.Items[3].item[0].Selected=True then					


Gruß Uwe