I am having one Delphi XE2 Project with 2 Buttons (Button1, Button2) and 1 Memo (Memo1).
My requirement is that on Button1 Click Some Text will be witten to Memo1 in the First Line (Line1). If I click again on Button1 Some New Text will be written in a New Line (Line2).
If I click on Button2 the Another New Text will be appended in Memo1 (After Last Line a new Line will be created). So I have written the following code :
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Text :='Line1';
Memo1.Lines.Text :='Line2';
end;
....
....
....
....
procedure TForm1.Button2Click(Sender: TObject);
begin
Memo1.Lines.Text :='Line3';
Memo1.Lines.Text :='Line4';
end;
But the problem is that only one line is showing with text as "Line1" on Button1FirstClick, "Line2" on Button1SecondClick and "Line4" on Button2Click. Please help me.