Autor Beitrag
danielpt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: So 10.08.03 14:13 
Hi!
Ich habe ne Frage:

z.B. Ich klicke auf "Speichern" und da ich das Dokument zuvor noch nicht gesichert wurde, öffnet sich der Dialog "Speichern unter...". Ich schreibt dann was und klicke wieder auf "Speichern"... Jetzt soll das Prog den Dialog nicht bringen sondern gleich in die zuvor erstellte Datei speichern.

Alles klar? :lol:

Bitte per SOURCECODE antworten... 8)

_________________
cu daniel
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: So 10.08.03 14:40 
danielpt hat folgendes geschrieben:
Alles klar?

Ja.

Zitat:
Bitte per SOURCECODE antworten... 8)

Und wieviel zahlst du dafür, dass wir dir dein Programm programmieren?

_________________
Ist Zeit wirklich Geld?
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: So 10.08.03 14:43 
:evil: Das find ich extrem witzig... :(

Ich bin immernoch ANFÄNGER! :mahn:

_________________
cu daniel
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: So 10.08.03 14:54 
Kleiner Tipp: Schau dir mal an, wie Borland das beim RichEdit Beispiel [$(DELPHI)\Demos\RichEdit] gelöst hat.

_________________
Ist Zeit wirklich Geld?
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: So 10.08.03 15:05 
das ist aber ne nummer zu hoch für mich... wie die das geproggt haben...

_________________
cu daniel
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: So 10.08.03 15:47 
Hallo,

Ich denke mal, du hättest auch HÖFLICHER fragen können, aber bitte: Ich denke mal, mit den Ereignissen kennst du dich aus ? Ansonsten lies besser erstmal irgendein Delphi-Buch o.ä.

CODE:
Definiere zuerst mal eine Variable (AFile):
ausblenden Delphi-Quelltext
1:
2:
3:
var
  Form1: TForm1;
  AFile: String='';

Und dann brauchst du die procedures:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
procedure TForm1.Speichern1Click(Sender: TObject);
begin
  if AFile='' then
  begin
    if SaveDialog1.Execute then
    begin
      RichEdit1.Lines.SaveToFile(SaveDialog1.FileName);
      AFile := SaveDialog1.FileName;
    end;
  end
  else
    RichEdit1.Lines.SaveToFile(AFile);
end;

procedure TForm1.Oeffnen1Click(Sender: TObject);
begin
  if (OpenDialog1.Execute and FileExists(OpenDialog1.FileName)) then
  begin
    RichEdit1.Lines.LoadFromFile(OpenDialog1.FileName);
    AFile := OpenDialog1.FileName;
  end;
end;

Also, für Fragen stehe ich zur Verfügung. Denk daran, die Parameter bei SaveDialog und OpenDialog noch einzustellen (also defaultExt, Filter, Title, usw) => siehe ObjectInspector.

Viele Grüsse.

Moderiert von user profile iconTino: Code-Tags hinzugefügt.
majolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: So 10.08.03 15:54 
@recall: Vielleicht noch die Delphi-Tags hinzufügen, dann wird der Code auch als Delphicode dargestellt, wozu haben wir denn eine so schöne Funktion. :D

_________________
Gruß
majolo
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: So 10.08.03 16:32 
thanks funzt super! ;)

Zitat:
Ich denke mal, du hättest auch HÖFLICHER fragen können, aber bitte:


Sorry, stimmt schon... :oops:

_________________
cu daniel
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: So 10.08.03 17:38 
@majolo:  Stimmt :D