Autor Beitrag
Xadron
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 14.04.07 17:15 
Habe eine Shell Treeview und Listview.
Möchte in Onclickverfahren der listview schreiben:
ausblenden Quelltext
1:
label1.caption:= ShellTreeView1.Path+'/'+ShellListView1.items[ShellListView1.ItemIndex];					


Soll sich also zusammensetzen aus dem Path von treeview z.B C:\test\
und den Dateinamen aus listview z.B. install.exe

also zusammen : C:\test\install.exe

Das bringe ich wie am besten zusammen?
Mein code weist auf jeden Fall paar Fehler auf.

wie:
Inkompatible Typen: 'String' und 'TShellFolder'

Aber ich weiß garnicht ob soetwas wie mein code überhaupt geht.

_________________
|x-32:88x+39-3|+3:21=47-4x
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 14.04.07 17:20 
Die Einträge in items sind nicht vom Typ string sondern vom Typ TShellFolder, weshalb das nicht klappt. Das steht auch schon in der Fehlermeldung. Wahrscheinlich hat TShellFolder eine Eigenschaft name oder filename oder sonstwas, in der der Dateiname steht. :wink:

PS: Selber denken geht nicht, oder? :roll:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 14.04.07 17:28 
Selbst denken geht...sieht man an meinem Code :?

Habe ja gelernt, dass man nach dem Objectnamen ein . schreiben kann und das dort alles mögliche aufgelistet wird.
Habe die lange liste durchsucht und nicht sinnvolleres als items gefunden.
->Filename habe ich nicht gesehen.

Kann man das irgendwie in String bekommen?
Inkompatible Typen: 'String' und 'TShellFolder'

???tostr

_________________
|x-32:88x+39-3|+3:21=47-4x


Zuletzt bearbeitet von Xadron am Sa 14.04.07 17:43, insgesamt 2-mal bearbeitet
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 14.04.07 17:34 
In meinem Post steht, dass filename oder name wahrscheinlich eine Eigenschaft von TShellFolder ist und nicht von TShellListView.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 14.04.07 17:43 
Ich dachte ich schreibe über den TShellListView?
Ist es denn mit der TShellListView nicht möglich?

zurück:
Kann man das irgendwie in String bekommen?
Inkompatible Typen: 'String' und 'TShellFolder'

???tostr

_________________
|x-32:88x+39-3|+3:21=47-4x
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 14.04.07 17:47 
Man, ich das denn so schwierig:
Die eigenschaft Name gehört einfach nicht direkt zum TShellListView sondern zum TShellListFolder, der unter anderem der Typ von items ist. Also muss es dann ungefähr so heißen:
ausblenden Delphi-Quelltext
1:
label1.caption:= ShellTreeView1.Path+'/'+ShellListView1.items[ShellListView1.ItemIndex].name;					

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 14.04.07 18:11 
Ach so..war recht undeutlich für mich :roll:

Alles klar, ich werde jetzt mal weiter nachdenkenen, was da noch hin muss.

_________________
|x-32:88x+39-3|+3:21=47-4x
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Sa 14.04.07 18:44 
könnt mir ja mal einen Tipp geben.
Hab einiges durchprobiert, doch irgendwie komme ich nicht zum erfolg.

label1.caption:=ShellTreeView1.Path+'\'+ShellListView1.Items.Item[ShellListView1.ItemIndex].SubItems.names[ShellListView1.ItemIndex];

ist aber immer noch nicht der Name der Datei

_________________
|x-32:88x+39-3|+3:21=47-4x
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 14.04.07 20:08 
Wie wärs denn einfach mit
ausblenden Delphi-Quelltext
1:
ShellListView1.SelectedFolder.PathName					

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 14.04.07 23:28 
user profile iconXadron hat folgendes geschrieben:
könnt mir ja mal einen Tipp geben.
Hab einiges durchprobiert, doch irgendwie komme ich nicht zum erfolg.

label1.caption:=ShellTreeView1.Path+''+ShellListView1.Items.Item[ShellListView1.ItemIndex].SubItems.names[ShellListView1.ItemIndex];

ist aber immer noch nicht der Name der Datei

Wer zum Teufel kommt denn bloß auf so etwas.

ausblenden Delphi-Quelltext
1:
label1.caption:=ShellTreeView1.Path+''+ShellListView1.Items.Item[ShellListView1.ItemIndex].SubItems.names[ShellListView1.ItemIndex];