Social Icons

Saturday, 15 March 2014

Working of LinkLabel

The LinkLabel control is similar to an ordinary label. But it has an underline and resembles a link on a webpage. The LinkLabel control can be used to link to files, directories, or web pages. When you place your mouse over the LinkLabel, the mouse pointer will turn into a hand.

we use using System.Diagnostics namespace for it.

for other working and details see the interface by download this so you can understand easily.


Download                                  click here to download interface

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace links
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        LinkLabel.Link link = new LinkLabel.Link();
        private void button1_Click(object sender, EventArgs e)
        {
            // Add a link to the LinkLabel.
            linkLabel1.Text = textBox1.Text;           
            link.LinkData = "http://" + textBox1.Text;
            linkLabel1.Links.Add(link);          
        }
              

     private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // Send the URL to the operating system.
            Process.Start(e.Link.LinkData as string);           
            linkLabel1.Links.Clear();
        }
   }
}

 Download by clicking here

No comments:

Post a Comment