• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

How can I make a TImage as a link?

Hello,

I have a TImage control on my form and I want to make it a link... I want when the user click on it, it opens the link in the default browser.

How can this be done?

Thanks.
0
AngryC
Asked:
AngryC
  • 2
1 Solution
 
CodedKCommented:
Hi AngryC.

Use the OnClick event of the Image.
Write this line :

ShellExecute(Handle, 'open', 'www.google.com', '', '', SW_SHOWMAXIMIZED);

:)
0
 
CodedKCommented:
It will look like this :

procedure TForm1.Image1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', 'www.google.com', '', '', SW_SHOWMAXIMIZED);
end;
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now