Autor Beitrag
Bronstein
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Mo 06.03.06 16:51 
Wie kann ich alle Einträge die es im TreeView gibt markieren

_________________
Es gibt keine dummen Fragen nur dumme Antworten!!!
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Di 07.03.06 12:18 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
items.beginupdate; //neuzeichnen verhindern
for i:= 0 to items.count do
begin
 items[i].Selected:=true;
end;
items.endupdate;


Ich glaube nicht, das es da was einfaches gab.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 07.03.06 18:02 
Habs mal probiert und festgestellt, dass die Methode bei mir nicht funktioniert. Außerdem muss es Count - 1 heißen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var
  X: Integer;
begin
  with Treeview1 do
  begin
    Items.BeginUpdate;
    for X := 0 to Items.Count - 1 do
      Items[X].Selected := True;
    Items.EndUpdate;
  end;
end;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Bronstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Mi 08.03.06 08:27 
Die Funktion funktioniert nicht es wird immer nur das letzte ausgewählt.

_________________
Es gibt keine dummen Fragen nur dumme Antworten!!!
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 08.03.06 09:06 
Treeview.Multiselect ändert daran auch nichts?
Bronstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Mi 08.03.06 13:20 
Ist auf true gesetzt, von Hand aus kann ich auch alle auswählen, möchte nur mit einem Button, dass alle ausgewählt sind.

_________________
Es gibt keine dummen Fragen nur dumme Antworten!!!
reichemi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 41

WinXP home + prof, SUSE 9.2
Delphi 6
BeitragVerfasst: Mi 08.03.06 13:43 
evtl. gehts mit TreeView1.Select(...) oder TreeView1.Subselect(...) ? :gruebel:
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 08.03.06 20:18 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  X: Integer;
begin
  for X := 0 to TreeView1.Items.Count - 1 do
    TreeView1.Subselect(TreeView1.Items[X]);
  TreeView1.SetFocus;
end;

(getestet)

So funktioniert es.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 08.03.06 21:47 
Aha bei Selected bleiben also wohl die Anzeigen nicht konsistent? Ich habe schon gedacht ich bin blöd ;)
Jaja die Kleinigkeiten der Programmierung :roll: