C# image link

How can i make an image a link for a site? For example i want when someone clicks the image to go at www.example.com
kyrenatorAsked:
Who is Participating?
 
SunnyDarkCommented:
Add a LinkLabel control, assign the Image property, clear the Text property, set the AutoSize property to false so you can play with the size...
Add this to the LinkClicked event:



private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.experts-exchange.com")
        }

Open in new window

0
 
SunnyDarkCommented:
You have to be more specific , what is your environment? Is it a web application ? ASP.NET? Windows application? Windows Forms, MFC, ??
You see what I mean...
0
 
kyrenatorAuthor Commented:
It is a Windows Form and the language i am writing is c#!
0
 
SunnyDarkCommented:
Sorry,
Actually use PictureBox and handle the Click event:


private void pictureBox1_Click_1(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.experts-exchange.com");
        }

Open in new window

0
 
kyrenatorAuthor Commented:
Thanks m8!
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.

All Courses

From novice to tech pro — start learning today.