DataGridViewLinkCell.VisitedLinkColor Property

 

Gets or sets the color used to display a link that has been previously visited.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public Color VisitedLinkColor { get; set; }

Property Value

Type: System.Drawing.Color

A Color that represents the color used to display a link that has been visited. The default value is the user's Internet Explorer setting for the visited link color.

Setting the VisitedLinkColor property of the owning column also sets the VisitedLinkColor property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value.

The following code example demonstrates the use of the DataGridViewLinkColumn.VisitedLinkColor property, which is similar to this property. This example is part of a larger example available in the DataGridViewComboBoxColumn class overview topic.

private void AddLinkColumn()
{
    DataGridViewLinkColumn links = new DataGridViewLinkColumn();

    links.UseColumnTextForLinkValue = true;
    links.HeaderText = ColumnName.ReportsTo.ToString();
    links.DataPropertyName = ColumnName.ReportsTo.ToString();
    links.ActiveLinkColor = Color.White;
    links.LinkBehavior = LinkBehavior.SystemDefault;
    links.LinkColor = Color.Blue;
    links.TrackVisitedState = true;
    links.VisitedLinkColor = Color.YellowGreen;

    DataGridView1.Columns.Add(links);
}

.NET Framework
Available since 2.0
Return to top
Show: