Autor Beitrag
bigmasterdenis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 48



BeitragVerfasst: Do 20.09.07 00:33 
Hallo Leute!

Ich versuche eine txt-Datei in ein TreeView reinzuladen:

ausblenden Quelltext
1:
TreeView1.LoadFromFile('C:\Documents and Settings\froggy\Desktop\temp.tmp');					


Klappt auch wunderbar. Das Problem ist nur, dass in die Textdatei zuvor Tabulatoren ala #9 reingeschrieben wurden, welche das TreeView nicht korrekt anzeigen kann. Statt einem Tab zeigt das TreeView nur ein | oder so was ähnliches an.

Hat jemand zufällig eine Erklärung für dieses Phänomen?


Danke und Gruss

bigmasterdenis
bigmasterdenis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 48



BeitragVerfasst: Fr 21.09.07 11:06 
...hat sich erledigt. Habs jetzt so gelöst, dass ich die Textzeile nehme, aus dieser das Tab-Zeichzen rausschmeiße und es dann später durch ein paar Spaces ersetze:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var 
    part1, part2, space, modiefiedRow: String;
begin
    space := 'hier leerzeichen';
...
    part1 := copy(StringList[i], 0, length('stelle bis zum Tab'));
    part2 := copy(StringList[i], length('stelle bis zum Tab'+#9), length(StringList[i]));
    modifiedRow := part1+space+part2;
...
TProgger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 148

XP
D6, D2007 prof
BeitragVerfasst: Fr 21.09.07 12:15 
In Files für TreeViews haben Tabzeichen eine besondere Bedeutung, sie bestimmen nämlich, in welcher Ebene (oder Baumtiefe) ein String angezeigt wird. Speicher mal ein gefülltes TreeView ab, dann siehst du es.