FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > HyperLinkCellType Class : LinkArea Property |
'Declaration Public Property LinkArea As LinkArea
'Usage Dim instance As HyperLinkCellType Dim value As LinkArea instance.LinkArea = value value = instance.LinkArea
public LinkArea LinkArea {get; set;}
Exception | Description |
---|---|
System.ArgumentException | Specified start is invalid; must be positive |
System.ArgumentException | Specified length is invalid; must be positive |
System.ArgumentException | Specified length is invalid; must be less than or equal to the length of the entire text |
This is a pair of numbers, the starting character number of the link and the length of the link in number of characters. The link is the text that appears underlined and becomes clickable. The starting character number is zero based; the first character is at position 0.
For example, "Click to See Our Web Site." has 26 characters counting the spaces and the period at the end. To underline and make part of the hyperlink only the words "See Our Web Site", use a LinkArea(9,16); in other words, start at the 10th character in the string and make 16 characters underlined and clickable. To have only the words "Web Site" linkable, use LinkArea(17,8) so the link would start at the 18th character and underline 8 characters.
To select the entire string, start at the very first character and use the Text.Length property to get the length of the string, as in LinkArea(0, cellname.Text.Length).
FarPoint.Win.Spread.CellType.HyperLinkCellType hlnkcell = new FarPoint.Win.Spread.CellType.HyperLinkCellType(); hlnkcell.BackgroundImage = new FarPoint.Win.Picture(Image.FromFile("..\\images\\mail16a.ico")); hlnkcell.Link = "http://www.fpoint.com"; hlnkcell.LinkArea = new LinkArea(9,16); hlnkcell.LinkColor = Color.DarkRed; hlnkcell.Text = "Click to See Our Web Site."; hlnkcell.VisitedLinkColor = Color.Gray; fpSpread1.Sheets[0].Cells[7,2].CellType = hlnkcell;
Dim hlnkcell As New FarPoint.Win.Spread.CellType.HyperLinkCellType() hlnkcell.BackgroundImage = new FarPoint.Win.Picture(Image.FromFile("..\images\mail16a.ico")) hlnkcell.Link = "http://www.fpoint.com" hlnkcell.LinkArea = new LinkArea(9,16) hlnkcell.LinkColor = Color.DarkRed hlnkcell.Text = "Click to See Our Web Site." hlnkcell.VisitedLinkColor = Color.Gray fpSpread1.Sheets(0).Cells(7,2).CellType = hlnkcell
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10