Autor Beitrag
manfred07
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Mi 31.05.06 02:13 
Hallo Delphi-Gemeinde,

ich brauche mal wieder Eure HILFE!
Wie kann ich mit einen Code eine bestimmte Text-Datei selektieren und das
auch im Treeview die Verzeichnise offen dann sind.

Danke im vorraus

Manfred
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 31.05.06 07:05 
Wie wäre die schöne TShellTreeview Komponente? Ansonsten ein paar mehr Infos bitte...
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Mi 31.05.06 08:59 
Mir ist völlig unklar was du willst:

Hast du jetzt ein TreeView oder einen ShellTreeView? und dann was willst du machen in deinem (Shell)TreeView ein Verzeichniss aufklappen?
Bitte genauer!
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Mi 31.05.06 18:47 
Sorry das ich das so schlecht rüber gebracht habe!

Wenn ich z.B. mir ein Verzeichnis selektieren lassen möchte, dann benutze ich folgenden Code:
Aber hier wird mir nur das erste Verzeichnis selektiert.....?
Es sollte aber das erste geöffnet sein und das zweite Verzeichnis selektiert sein, oder?
Und wie ist das wenn ich nun im Verzeichnis_2 eine Text-Datei habe und die soll selektiert werden?
Wie muß ich das anstellen?


TreeView1.Items.Item[i].Selected := TreeView1.Items.Item[i].Text = 'Verzeichnis_1\Verzeichnis_2\';
TreeView1.SetFocus;


Danke für jede Nachricht.....hoffe das es jetzt besser rüber kommt.

Gruß Manfred
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Do 01.06.06 07:12 
Also soll es ausklappen und das erste darunter selektiert sein?

ausblenden Delphi-Quelltext
1:
2:
treeview1.Selected.getFirstChild.Expand(false);
treeview1.Selected:=treeview1.Selected.getFirstChild;


Ansonsten nochmal gaaannnz laaaangggsam für uns zum mitschreiben :D
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Do 01.06.06 19:13 
Hi digi_c,

Danke schön für deine Antwort.
Das funktioniert auch, aber wie soll ich es anstellen das eine Datei selektiert wird? :gruebel:

z.B: Verzeichnis_1\Verzeichnis_2\Test.txt

Also das die Datei Test.txt selektiert wird.

Gruß Manfred :wave:
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Fr 02.06.06 06:49 
Achso da sind auch Verzeichnisse aber du willst NUR die Datei slektiert haben? Dann frag den ImageIndexdoch ab? Oder du hast an TreeNode.Data bestimmt eine Information hinterlegt, oder?
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Fr 02.06.06 12:25 
Hi digi_c,

:gruebel: also ich weiß jetzt nicht mehr weiter wie ich das anstellen muß :gruebel:
Ich lese in Treeview ein Laufwerk ein. Und möchte über eine Edit auf eine bestimmte Datei
springen (Test.txt die sich z.B. im Verzeichnis_1\Verzeichnis_2 befindet).

Wie ich jetzt das über ImageIndex oder TreeNode.Data machen soll? :oops:

Bitte :flehan: um Hilfe.....

Gruß Manfred
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 02.06.06 15:18 
Hallo,

hab gerade einen Beitrag zur Delphi-Library hinzugefügt,
vermute das es Dir auch weiterhilft.
:arrow: ...Node-Pfad (String) im TreeView suchen/selectieren?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Sa 03.06.06 12:13 
Hi Lannes,

genau das habe ich gesucht....DANKE! :flehan:

Schöne Grüße und schöne Pfingsten.

Manfred