HtmlLinkLabel class

HtmlLinkLabel class .
Download

HtmlLinkLabel class Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Jeff Key
  • Publisher web site:
  • Operating Systems:
  • Windows Vista/2003/XP/2000/98
  • File Size:
  • 3KB

HtmlLinkLabel class Tags


HtmlLinkLabel class Description

The LinkLabel class provided in System.Windows.Forms is nice, especially when the entire Text of the control is the hyperlink. Unfortunately, things get a bit harrier when the Link is a subset of the text. If you want multiple links in the control, it really gets messy and you need to create the links programmatically. Not only that, you need to manually wire in a handler, usually to launch a web PaGE. Who needs that? HtmlLinkLabel is a subclass of LinkLabel that takes a string (via the TextHtml property) with embedded HTML anchor tags (""). When the user clicks a link, System.Diagnostics.Process.Start(string) is called with the text in the "href" attribute passed as the parameter. If you would like to have the click do something other than start a process, you can subclass HtmlLinkLabel and override OnLinkClicked. The Link property of LinkLabelLinkClickedEventArgs contains a property called LinkData that references an HtmlLinkLabel.HtmlLinkLabelInfo object. The HtmlLinkLabel.HtmlLinkLabelInfo contains three properties: Href, Text and Index. The first two are self-explanatory and the third is the order of occurance of the link in the text. The index is only of Interest if you can't key off of the href or text because you have two or more controls with the same href and text.


HtmlLinkLabel class Related Software