try this. I havent done anything like this before so I used it as a learning exercise. thanks for the opportunity.
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int x;
TImage *image;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
x = 1;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
image = new TImage(this);
image->Parent = Form1;
image->Left = image->Width * x;
image->Picture->LoadFromFile ("key.bmp"

;
image->OnClick = imageClick;
x++;
}
// declare this as public in the form1 header
void __fastcall TForm1::imageClick(TObject *Sender)
{
if(dynamic_cast<TImage *>(Sender) != 0)
{
ShowMessage ("test Message one"

;
image = dynamic_cast<TImage *>(Sender);
}
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
delete image;
}
tomcruz.net