Autor Beitrag
ruhrpott-desire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 23



BeitragVerfasst: Do 10.01.08 17:24 
Hallo,
mal eine kleine Frage, wie ist es mir möglich bei klick auf einen Button, ein Fenster zu öffnen und eine beliebige Datei auszuwählen (Textdatei) welche bei erneutem Klick auf einen Button in dem neuen Fenster dann in eine Listbox geladen wird?

Ich habe es schon hinbekommen, eine Dateiexplorer ähnliche Ansicht zu erzeugen, allerdings kann ich nichts auswählen.

Über Hilfe würde ich mich freuen ;)

Gruß
ruhrpott-desire
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 10.01.08 17:31 
Wie wäre es denn mit einem OpenDialog.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
ruhrpott-desire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 23



BeitragVerfasst: Do 10.01.08 17:52 
Danke schonmal,
aber wie würde ich das Anwenden?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Do 10.01.08 17:56 
Du scheibst OpenDialog in deinen Quelltext, setzt den Cursor rein und drückst auf F1.
Alternativ bietet sich eine Suche hier im Forum oder bei Google und Konkurrenz an.

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



BeitragVerfasst: Do 10.01.08 17:58 
DU glaubst garnicht wie oft ichs mit google probiert habe ^^ aber gut, das ist schonmal was. Danke.
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Do 10.01.08 18:08 
Und laden mit Listbox1.Items.LoadFromFile (heißt das Items? Ich benutz sonst für sowas nur TMemo)

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
ruhrpott-desire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 23



BeitragVerfasst: Do 10.01.08 18:16 
Also gut, das öffnen läuft jetzt, nur das listbox verstehe ich noch nicht ganz, wo soll das hin?

Also das die gewählte datei auch eingefügt wird.
bflegel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 193
Erhaltene Danke: 1

Win XP, Win 7, BS2000
D5
BeitragVerfasst: Do 10.01.08 22:50 
Hallo,

jetzt verstehe ich Dich nicht so ganz. In Deinem ersten Beitrag hast Du doch geschrieben, dass die Datei in eine Listbox reingeladen werden soll. Also setze auf Deine Form eine Listbox und einen OpenDialog. Als nächstes schreibst Du folgenden Code:

ausblenden Delphi-Quelltext
1:
2:
if opendialog1.execute then
  listbox1.Items.LoadFromFile(opendialog1.filename);


In welche Prozedur das rein muss, darfst Du selbst rausfinden :wink:

Bye
bflegel

_________________
I know all the jokes about my name