All you need is a panel with 3 images and 3 labels.
Set the OnClick event for each image/label pair to point to the same procedure.
You could even doll it up to change font color on MouseOver like links on a web-page by pointing all 3 labels to the same procedure, like this:
Code:
procedure TContactMenu.LabelMouseEnter(Sender: TObject);
begin
with Sender as TLabel do Font.color:= clBlue
end;
procedure TContactMenu.LabelMouseLeave(Sender: TObject);
begin
with Sender as TLabel do Font.color:= clBlack
end;
You really only need one OnClick event for all 3 labels if you do it like this:
Code:
procedure TContactMenu.LabelClick(Sender: TObject);
begin
with Sender as TLabel do
if Name = 'Label1' then GoYahoo
else if Name = 'Label2' then GoGMail
else if Name = 'Label3' then GoHotMail;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.