?
Solved

LinkLabel C#

Posted on 2004-09-14
4
Medium Priority
?
3,037 Views
Last Modified: 2008-01-09
I want to make my link label to open the default browser and move to my website.
I also want to make the link lable use the default mail program to send me an e-mail.
How can I do that?
0
Comment
Question by:drtoto82
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:gillgates
ID: 12060214
mailto:youname@youdomain.com?subject=yousubject
0
 
LVL 3

Accepted Solution

by:
gillgates earned 200 total points
ID: 12060870
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
    {
        // Determine which link was clicked within the LinkLabel.
        this.linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true;

        // Display the appropriate link based on the value of the
        // LinkData property of the Link object.
        string target = e.Link.LinkData as string;

        // If the value looks like a URL, navigate to it.
        // Otherwise, display it in a message box.
        if(null != target && (target.StartsWith("www") || target.StartsWith("mailto:" )
        {
            System.Diagnostics.Process.Start(target);
        }
        else
        {    
            MessageBox.Show("Item clicked: " + target);
        }
    }
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is about my first experience with programming Arduino.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

771 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