In C Create a project named RecentlyVisitedSites that contai
In C# Create a project named RecentlyVisitedSites that contains a Form with a list of three LinkLabels that link to any other Web sites you choose. When a user clicks a LinkLabel, link to that site. When a user’s mouse hovers over a LinkLabel, display a brief message that explain’s the site’s purpose. After a user clicks a link, move the most recently selected link to the top of the list, and move the other two links down, making sure to retain the correct explanation with each link.
Solution
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CCroftonRecentlyVisitedSites
{
public partial class Form1 : Form
{
LinkLabel[] links = new LinkLabel[3];
public Form1()
{
InitializeComponent();
/*LinkLabel[] links = new LinkLabel[3];
links[0] = new LinkLabel();
links[0].Text = \"google.com\";
links[0].Location = new System.Drawing.Point(100, 25);
links[0].Links.Add(0, 0, \"www.google.com\");
this.Controls.Add(links[0]);*/
LinkLabel[] links = new LinkLabel[3];
links[0] = googleLabel;
links[1] = facebookLabel;
links[2] = twitterLabel;
Controls.Add(links[0]);
Controls.Add(links[1]);
Controls.Add(links[2]);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void googleLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(\"IExplore\", \"http://www.google.com\");
links[0] = googleLabel;
Controls.Remove(links[0]);
Controls.Add(links[0]);
}
private void facebookLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(\"IExplore\", \"http://www.facebook.com\");
links[0] = facebookLabel;
Controls.Remove(links[0]);
Controls.Add(links[0]);
}
private void twitterLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(\"IExplore\", \"http://www.twitter.com\");
links[0] = twitterLabel;
Controls.Remove(links[0]);
Controls.Add(links[0]);
}
private void flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
{
Controls.Add(links[0]);
Controls.Add(links[1]);
Controls.Add(links[2]);
}
}
}


