Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

C# image link

Posted on 2009-02-17
5
Medium Priority
?
2,882 Views
Last Modified: 2013-12-14
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
0
Comment
Question by:kyrenator
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:SunnyDark
ID: 23664079
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
 

Author Comment

by:kyrenator
ID: 23664124
It is a Windows Form and the language i am writing is c#!
0
 
LVL 8

Accepted Solution

by:
SunnyDark earned 2000 total points
ID: 23664354
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
 
LVL 8

Expert Comment

by:SunnyDark
ID: 23664385
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
 

Author Closing Comment

by:kyrenator
ID: 31548000
Thanks m8!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question