Autor Beitrag
Starfighter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 12.05.03 10:20 
Hallo,

ausblenden Quelltext
1:
2:
if OpenDialog1.Execute and (OpenDialog1.FileName<>'/lol.txt') then
  Memo1.Lines.LoadFromFile(OpenDialog1.FileName);


Wenn ich auf ein Button klicke soll er SOFORT den inhalt von txt in ein memo feld reinkopieren ohne das erst dieses opendialog kommt. Kann man das irendwie machen?

:)
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 12.05.03 10:27 
Meinst du das wirklich ernst?
Zitat:
Wenn ich auf ein Button klicke soll er SOFORT den inhalt von txt in ein memo feld reinkopieren ohne das erst dieses opendialog kommt. Kann man das irendwie machen?

Ja sicher! Du lässt
Zitat:
dieses opendialog

einfach weg und gibst stattdessen gleich den Dateinamen an :roll:
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 12.05.03 11:41 
ausblenden Quelltext
1:
 Memo1.Lines.LoadFromFile('C:\hallo.txt');					
Starfighter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 12.05.03 12:49 
ich bin ein trottel.. Sorry....

:oops: :oops: :oops: :oops:

Kann man das auch irendwie mit TListView zusammen bringen?

ListView1.Columns[0]. <-- ich habs mit Add ausprobiert aber geht nicht.. Schade!


Zuletzt bearbeitet von Starfighter am Mo 12.05.03 13:01, insgesamt 1-mal bearbeitet
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 12.05.03 12:50 
Dafür ist das Forum doch da.....
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 12.05.03 13:13 
Also, sowas macht man mit Items. Du könnets eigene Items mit ListBox1.Items.add ('Item1'); Wenn du Items aus einer Datei laden willst musst du das verwenden:  ListBox1.Items.LoadFromFile('C:\test.txt');

Du musst ebahcten das der INhalt der Datei so aussehen muss:

ausblenden Quelltext
1:
2:
Item1
Item2