• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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