Autor Beitrag
110022
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 18:40 
hab mir mal was ziemlich kompliziertes ausgedacht.
Ich will ein Programm machen , dass alle Dateien aus einem Ordner
zeigt.
Bei doppelklick auf eine Datei wied sie geöffnet.
leider habe ich keine ahnung wie ich die dateien reinbakommen soll
also ob in ne listbox oder in was anderes.
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 18:47 
deplhi hilfe Findfirst Findnext
ausblenden Delphi-Quelltext
1:
2:
3:
Die Funktion FindFirst sucht in einem Verzeichnis nach dem ersten Vorkommen einer bestimmten Datei mit den angegebenen Attributen.

function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;
ausblenden Delphi-Quelltext
1:
2:
3:
Die Funktion FindNext sucht nach dem nächsten Eintrag, der mit den in einem vorhergehenden Aufruf von FindFirst angegebenen Dateiinformationen übereinstimmt.

function FindNext(var F: TSearchRec): Integer;
ausblenden Delphi-Quelltext
1:
2:
3:
Die Prozedur FindClose gibt den mit FindFirst zugewiesenen Speicher frei.

procedure FindClose(var F: TSearchRec);
Füllt die listbox
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
const path='c:\';
procedure TForm1.Button1Click(Sender: TObject);
var  Found     : integer;
     SearchRec : TSearchRec;
begin
 Found := FindFirst(path+'*.*', 255, SearchRec);
 while Found = 0 do
 begin
  listbox1.items.add(path+SearchRec.Name);
  Found := FindNext(SearchRec);
 end;
 FindClose(SearchRec);
end;

und bei doppelklick die date in 2. Listbox anzeigen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.ListBox1DblClick(Sender: TObject);//Listbox  OnDblClick Ereignis
begin
 listbox2.Clear;
 listbox2.Items.LoadFromFile(listbox1.items.Strings[listbox1.ItemIndex]);
end;


Zuletzt bearbeitet von LorenzS am Sa 22.12.07 19:06, insgesamt 1-mal bearbeitet
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Sa 22.12.07 19:01 
(a) indem Du die Suche in der Entwickler-Ecke SUCHE hier benutzt, das Thema kommt öfters vor
(b) mehr Eigeninitiative zeigst
(c) schau mal hier

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 19:10 
110022, wenn du schon eine neue Sprache Lernst oder Ganz mit dem programmieren anfängst, es gibt sehr Gute Bücher zu Thema programmieren oder Delphi für Anfänger.
Die Kosten zwar was aber erleichtern den Einstieg ungemein. Und wenn ihr programmieren in der Schule habt, das du deine Lehrer mal frage welches Buch er zur Schulstundenvorbereitung benutzt. Und es dir dann kaufen.
Ich meine nicht für Dummies.
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 19:13 
habs noch nich inner schule aber kommt noch :D

aber mal beiseite.
das is zwar gan nett aber ich meinte eigendlich sowas ähnliches wie die normalen fenster bei windows .nur ohne toolbar usw.
wie klappt das denn?

edit: als kleine nebenfrage kann man hier den eigenen mitgliedsnamen ändern?


Zuletzt bearbeitet von 110022 am Sa 22.12.07 19:16, insgesamt 1-mal bearbeitet
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 22.12.07 19:16 
Bei Delphi7, was du laut Profil verwendest, gibts unter Samples (bzw. Beispiele) den Shelltreeview und andere Komponenten, die mit Shell... anfangen. Damit kann man machen, was du willst.

_________________
We are, we were and will not be.
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 19:21 
user profile icon110022 hat folgendes geschrieben:

das is zwar gan nett aber ich meinte eigendlich sowas ähnliches wie die normalen fenster bei windows .nur ohne toolbar usw.
wie klappt das denn?

was is an einem Formular bitte nicht normal?
das beispiel war für ein formular mit 1 oder 2 listboxen
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 19:23 
klappt mit deinem qt alles auch wunderbar,
aber ich meinte eher sowas wie das normale windows fenster.
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 19:25 
es gibt noch "normalere windows fenster" ?
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 19:28 
sowas wie das hier.
Einloggen, um Attachments anzusehen!
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 19:36 
Das ist kein windows fenster, das ist ein explorer fenster und das kannst du doch auch nachbauen
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 19:37 
will ich ja auch, aber wie?
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: Sa 22.12.07 19:48 
user profile icon110022 hat folgendes geschrieben:
will ich ja auch, aber wie?


So wie es Gausi bereits gesagt hat:

Zitat:
Bei Delphi7, was du laut Profil verwendest, gibts unter Samples (bzw. Beispiele) den Shelltreeview und andere Komponenten, die mit Shell... anfangen. Damit kann man machen, was du willst.
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 19:49 
hab aber keine lust das einfach zu kopieren und gut.
wills selber machen nich n fertiges nehmen.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Sa 22.12.07 19:53 
user profile icon110022 hat folgendes geschrieben:
hab aber keine lust das einfach zu kopieren und gut.
wills selber machen nich n fertiges nehmen.
Dann tue es auch selber, :wink: und stelle Fragen zu konkreten Problemen und nicht zum ganzen Programm.

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 22:21 
so hab jetzt mal selber angefangen....
dann kommt hier die erste frage:
hab das ganze jetzt mit ShellListView gemacht .
da is ja schon alles drinne.
wie kommeich denn wieder einen schritt zurück?
bsp. Arbeitsplatz--->Festplatte C--->Progamme--->.....
Wie komme ich vom ordner Programme wieder zurück zu festplatte C?
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 22:23 
kommt davon wenn man es nicht selber schreibt
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 22:34 
habs doch selber bist jetzt gemacht aber hab keine ahnung wie ich das machen soll.

Arbeitsplatz--->Festplatte C--->Progamme--->.....
Wie komme ich vom ordner Programme wieder zurück zu festplatte C?
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 23:10 
ich meinet selber schreiben und nicht eine vorgefertigte komponente nutzen und sich wundern das es nicht so geht wie man es sich vortsellt. du kannst du mal debuggen und sehen was in der komponente beim doppelklick so passiert.

Komisch Delphi 3 und Turbodelphi(nur als demo) hat garkein Shelltreeview


Zuletzt bearbeitet von LorenzS am Sa 22.12.07 23:40, insgesamt 2-mal bearbeitet
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Sa 22.12.07 23:13 
hab aber keine ahnung wie der debugger funktioniert
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.