LinkArea in LinkLabel : LinkLabel « GUI « VB.Net Tutorial






LinkArea in LinkLabel
imports System
imports System.Drawing
imports System.Windows.Forms

public class LinkLabelsLinkArea : inherits Form
  dim lnkMsft as LinkLabel
  dim lnkLA as LinkLabel

  public sub New()
    Size = new Size(300,250)

    '  use Text property & LinkArea
    lnkMsft = new LinkLabel()
    lnkMsft.Parent = me
    lnkMsft.Text = "www.microsoft.com"
    lnkMsft.Location = new Point(0,0)
    lnkMsft.AutoSize = true
    lnkMsft.BorderStyle = BorderStyle.None
    lnkMsft.LinkArea = new LinkArea(4,9)
    AddHandler lnkMsft.LinkClicked, AddressOf lnkMsft_LinkClicked

  end sub

  public shared sub Main() 
    Application.Run(new LinkLabelsLinkArea())
  end sub

  private sub lnkMsft_LinkClicked(ByVal sender as object,  ByVal e as LinkLabelLinkClickedEventArgs)
      lnkMsft.Links(lnkMsft.Links.IndexOf(e.Link)).Visited = true
       System.Diagnostics.Process.Start(lnkMsft.Text)
  end sub

end class








14.14.LinkLabel
14.14.1.Get LinkData from LinkLabelGet LinkData from LinkLabel
14.14.2.LinkLabel local actionLinkLabel local action
14.14.3.LinkArea in LinkLabelLinkArea in LinkLabel
14.14.4.Link AddLink Add
14.14.5.Multiple links and generic handlerMultiple links and generic handler
14.14.6.Using LinkLabels to create hyperlinksUsing LinkLabels to create hyperlinks
14.14.7.Load File ExploreLoad File Explore
14.14.8.Load BrowserLoad Browser
14.14.9.Load Window ApplicationLoad Window Application
14.14.10.Set Label Border styleSet Label Border style
14.14.11.Set LinkLabel ImageListSet LinkLabel ImageList
14.14.12.LinkLabel: LinkArea, LinkColor, VisitedLinkColor, ActiveLinkColorLinkLabel: LinkArea, LinkColor, VisitedLinkColor, ActiveLinkColor