Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bmp in RadioButon

Status
Not open for further replies.
Perhaps using owner draw methods. For myself, I'm lazy, and I'd likely just setup a tbitmap next to a label.
 
Why do you even need a Radio group?

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;
Sometimes you have to think outside the box. ;-)

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top