Memo problem...

Hi I'm new here and i need help...
I got for my school project to make Calculator in c++. But i cant get memo1 to show all the numbers in one row without deleting the previous entry. Can anyone help me to solve that?
i have one memo and 9 panels (numbers).
Here is the code and the pic.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "prog.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::PanelbrClick(TObject *Sender)
{TPanel*pnx=dynamic_cast<TPanel*>(Sender);
Memo1->Text=pnx->Caption;


}
//--------------------------------------------------------------------------- 


and here is the image
http://i47.tinypic.com/35jz18i.jpg


As you can see i have 9 panels for numbers and when i click on one of them memo1 shows the number BUT when i click any other number the previous deletes and memo1 shows the number i clicked...

problem:
http://i48.tinypic.com/v3hfcw.jpg
http://i47.tinypic.com/b85jx0.jpg

I don't think the code you give here is enough.
Is Memo1->Text a string?
if so, try Memo1->Text += pnx->Caption;
Thats all the coding... i'm sure that i'm wrong somewhere...
Memo1->Text isnt a string. and that code you gave me, it wont work, i mean there is no errors while compiling but Panels 1-9 aren't responding on clicks...
is there any other code?
Topic archived. No new replies allowed.