unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Menus, StdCtrls;
type
TForm1 =
class(TForm)
RichEdit1: TRichEdit;
MainMenu1: TMainMenu;
est1: TMenuItem;
ffnen1: TMenuItem;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
Speichern1: TMenuItem;
procedure Speichern1Click(Sender: TObject);
procedure ffnen1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ffnen1Click(Sender: TObject);
begin
if opendialog1.Execute
then
begin
if FileExists(OpenDialog1.Filename)
then
begin
Richedit1.Lines.loadfromfile(opendialog1.Filename);
end
else
Application.MessageBox ('
Die Datei wurde leider nicht gefunden.','
Datei nicht gefunden',0+16);
end;
end;
procedure TForm1.Speichern1Click(Sender: TObject);
begin
if savedialog1.Execute
then
begin
if savedialog1.Filename<>'
'
then
begin
richedit1.lines.savetofile(savedialog1.filename);
end;
end;
end;
end.