GrapeCity MultiRow Windows Forms Documentation
ActiveLinkColor Property
Example 


Gets or sets the System.Drawing.Color used to display an active link.
Syntax
<SRDescriptionAttribute("Indicates the color of the hyperlink when the user clicks the link.")>
<SRCategoryAttribute("Appearance")>
Public Property ActiveLinkColor As Color
Dim instance As LinkLabelCell
Dim value As Color
 
instance.ActiveLinkColor = value
 
value = instance.ActiveLinkColor
[SRDescription("Indicates the color of the hyperlink when the user clicks the link.")]
[SRCategory("Appearance")]
public Color ActiveLinkColor {get; set;}

Property Value

A System.Drawing.Color that represents the color used to display a link that is being selected. The default value is the user's Internet Explorer setting for the link color when the mouse is over it.
Remarks
Refer to the System.Windows.Forms.LinkLabel in MSDN.
Example
The following code example shows how to customize a link label cell's behavior or appearance. This code example is part of a larger example provided for the LinkLabelCell class.
private LinkLabelCell CreateAddressLinkLabelCell()
        {
            LinkLabelCell linkLabelCell = new LinkLabelCell();

            linkLabelCell.Selectable = false;

            linkLabelCell.Name = "Address";

            // Customize behavior of link label.
            linkLabelCell.LinkBehavior = LinkBehavior.HoverUnderline;

            // Customize colors when link label is in different state.
            linkLabelCell.LinkColor = Color.Blue;

            linkLabelCell.ActiveLinkColor = Color.Red;

            linkLabelCell.VisitedLinkColor = Color.Purple;

            return linkLabelCell;
        }

        void gcMultiRow1_CellClick(object sender, CellEventArgs e)
        {
            if (e.CellName == "Address")
            {
                object value = gcMultiRow1[e.RowIndex, e.CellIndex].Value;
                if (value != null)
                {
                    Process.Start(value.ToString());
                }
            }
        }
Private Function CreateAddressLinkLabelCell() As LinkLabelCell
        Dim linkLabelCell As New LinkLabelCell()

        linkLabelCell.Selectable = False

        linkLabelCell.Name = "Address"

        ' Customize behavior of link label.
        linkLabelCell.LinkBehavior = LinkBehavior.HoverUnderline

        ' Customize colors when link label has a different status.
        linkLabelCell.LinkColor = Color.Blue

        linkLabelCell.ActiveLinkColor = Color.Red

        linkLabelCell.VisitedLinkColor = Color.Purple

        Return linkLabelCell
    End Function

    Private Sub gcMultiRow1_CellClick(ByVal sender As Object, ByVal e As CellEventArgs) Handles 
gcMultiRow1.CellClick
        If e.CellName = "Address" Then
            Dim value As Object = gcMultiRow1(e.RowIndex, e.CellIndex).Value
            If value <> Nothing Then
                Process.Start(value.ToString())
            End If
        End If
    End Sub
Requirements

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

See Also

Reference

LinkLabelCell Class
LinkLabelCell Members
LinkColor Property
VisitedLinkColor Property

 

 


Copyright © GrapeCity, inc. All rights reserved.