i am trying to change the description for each website that the mouse is hover at
according to the assignment
hoe can i change it from "go to Gizmodo website" to "Gizmodo is a tech blog"
and do the rest with the other websites descriptions with different descriptions
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;
namespace recenntlyVisited
{
public partial class Form1 : Form
{
string[] urls = { "www.Gizmodo.com", "www.Lifehacker.com", "www.techcrunch.com" };
List<LinkLabel> li = new List<LinkLabel>();
List<Point> p = new List<Point>();
public Form1()
{
InitializeComponent();
label1 = new Label();
label1.Location = new Point(128, 30);
label1.Width = 600;
label1.Text = "";
this.Controls.Add(label1);
li.Add(new LinkLabel());
li.Add(new LinkLabel());
li.Add(new LinkLabel());
li[0].Text = "Gizmodo.com";
li[1].Text = "lifehacker.com";
li[2].Text = "techcrunch.com";
p.Add(new Point(20, 10));
p.Add(new Point(20, 35));
p.Add(new Point(20, 60));
for (int i = 0; i < li.Count(); i++)
{
li[i].Location = p[i];
li[i].Links.Add(0, li[i].Text.Length, urls[i]);
li[i].MouseHover += new EventHandler(Form1_MouseHover);
li[i].MouseLeave += new EventHandler(Form1_MouseLeave);
li[i].MouseClick += new MouseEventHandler(Form1_MouseClick);
this.Controls.Add(li[i]);
}
}
void Form1_MouseClick(object sender, MouseEventArgs e)
{
LinkLabel ll = sender as LinkLabel;
string name = ll.Text;
string[] newUrls = new string[3];
p.Clear();
if (name.Contains("Gizmodo"))
{
p.Add(new Point(20, 10));
p.Add(new Point(20, 35));
p.Add(new Point(20, 60));
}
else if (name.Contains("lifehacker"))
{
p.Add(new Point(20, 60));
p.Add(new Point(20, 10));
p.Add(new Point(20, 35));
label1.Text = "Go to " + ll.Text + " website";
}
else if (name.Contains("techcrunch"))
{
p.Add(new Point(20, 35));
p.Add(new Point(20, 10));
p.Add(new Point(20, 60));
}
for (int i = 0; i < li.Count(); i++)
{
li[i].Location = p[i];
}
System.Diagnostics.Process.Start(((LinkLabel)sender).Links[0].LinkData.ToString());
}
void Form1_MouseLeave(object sender, EventArgs e)
{
label1.Text = "";
}
void Form1_MouseHover(object sender, EventArgs e)
{
LinkLabel ll = sender as LinkLabel;
label1.Text = "Go to " + ll.Text + " website";
}
}
}