unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm2 = class(TForm)
Memo1: TMemo;
SaveDialog1: TSaveDialog;
OpenDialog1: TOpenDialog;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Memo2: TMemo;
Label1: TLabel;
Label2: TLabel;
procedure Edit1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
memo2.Lines.Add(memo1.Lines.Text) ;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
if memo2.SelLength>0 then
memo2.CutToClipboard;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
if memo2.SelLength >0 then
memo2.CopyToClipboard;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
if memo2.SelLength = 0 then
memo2.PasteFromClipboard;
end;
procedure TForm2.Button5Click(Sender: TObject);
begin
if savedialog1.Execute then
memo2.Lines.SaveToFile(savedialog1.FileName);
end;
procedure TForm2.Button6Click(Sender: TObject);
begin
if opendialog1.Execute then
memo2.Lines.LoadFromFile(opendialog1.FileName);
end;
procedure TForm2.Edit1Change(Sender: TObject);
begin
memo1.Lines[0]:='aaaaa';
end;