Quote Originally Posted by new user
sorry for bein a bother, but how could i make it so when i clicked on one of the labels, something would happen like:
showmessage('hello')
thanks again
[pascal]TForm1 = class(TForm)
private
procedure MyEvent(Sender: TObject);
public
...
end;

procedure TForm1.MyEvent(Sender: TObject);
begin
if Sender is TLabel begin
ShowMessage((Sender as TLabel).Caption);
end;
end;
[/pascal]

Upon creating the label

[pascal]
with TLabel.Create(Form1)
begin
...
OnClick := MyEvent;
...
end;
[/pascal]