ToolStripLabel.VisitedLinkColor ToolStripLabel.VisitedLinkColor ToolStripLabel.VisitedLinkColor ToolStripLabel.VisitedLinkColor Property


이전에 열어 보았던 링크를 표시할 때 사용되는 색을 가져오거나 설정합니다.Gets or sets the color used when displaying a link that has been previously visited.

 property System::Drawing::Color VisitedLinkColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color VisitedLinkColor { get; set; }
member this.VisitedLinkColor : System.Drawing.Color with get, set
Public Property VisitedLinkColor As Color

속성 값

열어 보았던 링크를 표시하는데 사용된 색을 나타내는 Color입니다.A Color that represents the color used to display links that have been visited. 기본 색은 시스템에서 지정됩니다.The default color is specified by the system. 대개 이 색은 Color.Purple입니다.Typically, this color is Color.Purple.


다음 코드 예제에는 초기화 하는 방법을 보여 줍니다.는 ToolStripLabel 설정 하 여 링크를 포함 하는 IsLink, LinkColor, ActiveLinkColor, VisitedLinkColorLinkVisitedLinkBehavior 속성입니다.The following code example demonstrates how to initialize a ToolStripLabel to contain a link by setting the IsLink, LinkColor, ActiveLinkColor, VisitedLinkColor, LinkVisited and LinkBehavior properties.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

public class Form1 : Form
    private ToolStripLabel toolStripLabel1;
    private ToolStrip toolStrip1;

    public Form1()
    static void Main()
        Application.Run(new Form1());

    private void InitializeComponent()
        this.toolStrip1 = new System.Windows.Forms.ToolStrip();
        this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
        // toolStrip1
        this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.toolStrip1.Location = new System.Drawing.Point(0, 0);
        this.toolStrip1.Name = "toolStrip1";
        this.toolStrip1.Size = new System.Drawing.Size(292, 25);
        this.toolStrip1.TabIndex = 0;
        this.toolStrip1.Text = "toolStrip1";
        // toolStripLabel1
        this.toolStripLabel1.IsLink = true;
        this.toolStripLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.AlwaysUnderline;
        this.toolStripLabel1.Name = "toolStripLabel1";
        this.toolStripLabel1.Size = new System.Drawing.Size(71, 22);
        this.toolStripLabel1.Tag = "";
        this.toolStripLabel1.Text = "Search MSDN";
        this.toolStripLabel1.Click += new System.EventHandler(this.toolStripLabel1_Click);
        // Form1
        this.ClientSize = new System.Drawing.Size(292, 273);
        this.Name = "Form1";


    private void toolStripLabel1_Click(object sender, EventArgs e)
        ToolStripLabel toolStripLabel1 = (ToolStripLabel)sender;

        // Start Internet Explorer and navigate to the URL in the
        // tag property.
        System.Diagnostics.Process.Start("IEXPLORE.EXE", toolStripLabel1.Tag.ToString());

        // Set the LinkVisited property to true to change the color.
        toolStripLabel1.LinkVisited = true;
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms

Public Class Form1
   Inherits Form
   Private WithEvents toolStripLabel1 As ToolStripLabel
   Private toolStrip1 As ToolStrip
   Public Sub New()
   End Sub
   <STAThread()>  _
   Shared Sub Main()
      Application.Run(New Form1())
   End Sub
   Private Sub InitializeComponent()
      Me.toolStrip1 = New System.Windows.Forms.ToolStrip()
      Me.toolStripLabel1 = New System.Windows.Forms.ToolStripLabel()
      ' toolStrip1
      Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripLabel1})
      Me.toolStrip1.Location = New System.Drawing.Point(0, 0)
      Me.toolStrip1.Name = "toolStrip1"
      Me.toolStrip1.Size = New System.Drawing.Size(292, 25)
      Me.toolStrip1.TabIndex = 0
      Me.toolStrip1.Text = "toolStrip1"
      ' toolStripLabel1
      Me.toolStripLabel1.IsLink = True
      Me.toolStripLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.AlwaysUnderline
      Me.toolStripLabel1.Name = "toolStripLabel1"
      Me.toolStripLabel1.Size = New System.Drawing.Size(71, 22)
      Me.toolStripLabel1.Tag = ""
      Me.toolStripLabel1.Text = "Search MSDN"
      ' Form1
      Me.ClientSize = New System.Drawing.Size(292, 273)
      Me.Name = "Form1"
   End Sub
   Private Sub toolStripLabel1_Click(sender As Object, e As EventArgs) Handles toolStripLabel1.Click
      Dim toolStripLabel1 As ToolStripLabel = CType(sender, ToolStripLabel)
      ' Start Internet Explorer and navigate to the URL in the
      ' tag property.
      System.Diagnostics.Process.Start("IEXPLORE.EXE", toolStripLabel1.Tag.ToString())
      ' Set the LinkVisited property to true to change the color.
      toolStripLabel1.LinkVisited = True
   End Sub
End Class


이 속성을 사용 하면 모든 링크 표시 되는 색을 지정할 수 있습니다는 ToolStripLabel 사용자가 방문 하는 합니다.This property enables you to specify the color that is displayed for all links in the ToolStripLabel that have been visited by the user.


이 속성을 설정할 때 되도록 색 설정한 컨트롤의 배경색을 사용 하 여 충돌 하지 않는 속성의 텍스트가 제대로 표시 되지 않습니다.When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. 예를 들어 컨트롤의 배경색 Color.Red 이 속성을 설정 하 고 Color.Red, 링크를 방문한 링크로 표시 되 면 텍스트를 제대로 다루지 않습니다.For example, if the background color of the control is Color.Red and this property is set to Color.Red, the text is not shown properly when the link is displayed as a visited link.

적용 대상