Visual Basic (Declaration) | |
---|---|
Public Property LinkArea As LinkArea |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As HyperLinkCellType Dim value As LinkArea instance.LinkArea = value value = instance.LinkArea |
C# | |
---|---|
public LinkArea LinkArea {get; set;} |
Property Value
LinkArea object that defines the location of the hyperlink within the link textException | 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).
C# | Copy Code |
---|---|
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; |
Visual Basic | Copy Code |
---|---|
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 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2