Autor Beitrag
del1312
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190



BeitragVerfasst: Fr 10.10.03 11:26 
Ich hab ne FileListBox die Dateien anzeigt und die ich verschieben möchte und hab dazu nen Button mit folgendem Inhalt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
name:string;
begin
name:=(FileListBox1.items[0]);
MoveFile(PChar(filelistbox1.items[0]), PChar('C:\' + name));
FileListBox1.Update;
end;


Das Ganze funzt auch supi, nur leider eben verschiebt er immer nur das Item[0] ich will aber die grad selektierte Datei verschieben. Was muss ich dazu ändern? Danke schonmal! :D [/code]
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Fr 10.10.03 11:42 
TListBox.FileName

barfuesser
del1312 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190



BeitragVerfasst: Fr 10.10.03 11:53 
hm danke aber so richtig klappt das nicht. wenn ich alles ersetze:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var 
name:string
begin 
name:=(FileListBox1.Filename); 
MoveFile(PChar(filelistbox1.Filename), PChar('C:\' + name)); 
FileListBox1.Update; 
end;


dann passiert einfach nichts. die datei wird nicht mehr verschoben. :oops: :?
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Fr 10.10.03 12:31 
ausblenden Delphi-Quelltext
1:
MoveFile(PChar(filelistbox1.FileName), PChar('C:\' + ExtractFileName(filelistbox1.FileName)));					

barfuesser
del1312 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190



BeitragVerfasst: Fr 10.10.03 12:41 
ja stimmt, damit entferne ich den pfad der datei oder? danke klappt jetzt alles :D