Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Listbox1 + Caption +Listbox2 +Pfad (https://www.delphipraxis.net/11870-listbox1-caption-listbox2-pfad.html)

horst 15. Nov 2003 16:14


Listbox1 + Caption +Listbox2 +Pfad
 
hallo...ich brauche hilfe
ich habe 2 listboxen.
in listbox1 steht die caption für ein programm
und in listbox2 steht der programmpfad.
dann speichere ich beiden listboxen in zwei verschiedene dateien.

mein problem ist:
wenn ich listbox1 sortiert haben will (also sorted=true)
dann klappt das mit dem pfad zum programm nicht mehr.


Delphi-Quellcode:
//das ist das speichern
procedure TForm2.Button2Click(Sender: TObject);
begin
if opendialog1.Execute= true then
begin
form1.listbox2.items.add(opendialog1.Filename);
edit1.Text:= opendialog1.Filename;
form1.listbox2.items.savetoFile(extractfilepath(application.exename)+ 'links.txt');
form1.listbox1.items.add(edit2.text);
form1.listbox1.items.savetoFile(extractfilepath(application.exename)+ 'oben.txt');
//Button1.click;
close;
end;
end;

// das passiert beim klick in listbox1 

procedure TForm1.ListBox1DblClick(Sender: TObject);
var
  i: integer;
  s: string;
begin
  for i := 0 to listbox1.items.count - 1 do
  begin
    s := listbox1.items[i];
    if ListBox1.Selected[i] then
    begin
      ShellExecute(Handle, 'open', PChar(Listbox2.items[i]), nil, nil, SW_SHOWNORMAL);
    end;
  end;

Luckie 15. Nov 2003 16:24

Re: Listbox1 + Caption +Listbox2 +Pfad
 
Ich würde einen Listview empfehlen.

horst 15. Nov 2003 16:31

Re: Listbox1 + Caption +Listbox2 +Pfad
 
geht das damit besser, wie muss ich das machen?

Luckie 15. Nov 2003 16:32

Re: Listbox1 + Caption +Listbox2 +Pfad
 
Ein Listview hat Spalten.

horst 15. Nov 2003 16:34

Re: Listbox1 + Caption +Listbox2 +Pfad
 
ja klar...stimmt ja ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:28 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz