visual studio - "Recently Visited Sites" Application in C# -
let me clear air first: yes, classwork. no, don't want answer. stuck , looking assistance.
i'll specific can. think best way can post prompt book gives:
create project named recentlyvisitedsites contains form list of 3 linklabels link 3 web sites choose. when user clicks linklabel, link site. when user's mouse hovers on linklabel, display brief message explains site's purpose. after user clicks link, move selected link top of list, , move other 2 links down, making sure retain correct explanation each link.
my main problem can't find way make "list" of linklabels both allows me use linklabels in first place and lets me rearrange items in list-fashion. here best go @ it:
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 recentlyvisitedsites { 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; linkspanel.controls.add(links[0]); linkspanel.controls.add(links[1]); } private void googlelabel_linkclicked(object sender, linklabellinkclickedeventargs e) { system.diagnostics.process.start("iexplore", "http://www.google.com"); links[0] = googlelabel; linkspanel.controls.remove(links[0]); linkspanel.controls.add(links[0]); } private void facebooklabel_linkclicked(object sender, linklabellinkclickedeventargs e) { system.diagnostics.process.start("iexplore", "http://www.facebook.com"); links[0] = facebooklabel; linkspanel.controls.remove(links[0]); linkspanel.controls.add(links[0]); } } }
and stuck either because links won't show up, or can't use them way prompt seems want, or other thing. commented-out code else tried using after asking teacher, didn't out of our conversation , didn't work either.
what should doing these links display on page, in list, can have them clickable, open stated web page in browser, , able rearrange them way prompt asks?
again, i'm not asking given answer, have hit wall , i'm frustrated because can't seem find decent explanation me understand need doing. appreciated.
use format each linklabel
on form1
:
linklabel.linkvisited = true; system.diagnostics.process.start("iexplore, http://www.facebook.com");
Comments
Post a Comment