TreeView.LineColor TreeView.LineColor TreeView.LineColor TreeView.LineColor Property

Definición

Obtiene o establece el color de las líneas que conectan los nodos del control TreeView.Gets or sets the color of the lines connecting the nodes of the TreeView control.

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

Valor de propiedad

El color Color de las líneas que conectan los nodos de árbol.The Color of the lines connecting the tree nodes.

Ejemplos

En el ejemplo de código siguiente se TreeNode muestra cómo establecer el color de línea.The following code example demonstrates setting the TreeNode line color. Para ejecutar este ejemplo, pegue el código en un Windows Form.To run this example, paste the code into a Windows Form. Llame InitializeLineTreeView a desde el constructor del formulario Load o el controlador de eventos.Call InitializeLineTreeView from the form's constructor or Load event handler.

private:
    TreeView^ lineTreeView;

public:
    void InitializeLineTreeView()
    {
        lineTreeView = gcnew TreeView();
        lineTreeView->Size = System::Drawing::Size(200, 200);

        lineTreeView->LineColor = Color::Red;

        // Create the root nodes.
        TreeNode^ docNode = gcnew TreeNode("Documents");

        // Add some additional nodes.
        docNode->Nodes->Add("phoneList.doc");
        docNode->Nodes->Add("resume.doc");

        lineTreeView->Nodes->Add(docNode);
        this->Controls->Add(lineTreeView);
    }
private TreeView lineTreeView;
public void InitializeLineTreeView()
{
    lineTreeView = new TreeView();
    lineTreeView.Size = new Size(200, 200);

    lineTreeView.LineColor = Color.Red;

    // Create the root nodes.
    TreeNode docNode = new TreeNode("Documents");
   
    // Add some additional nodes.
    docNode.Nodes.Add("phoneList.doc");
    docNode.Nodes.Add("resume.doc");
    
    lineTreeView.Nodes.Add(docNode);
    Controls.Add(lineTreeView);
}
Private lineTreeView As TreeView

Public Sub InitializeLineTreeView() 
    lineTreeView = New TreeView()
    lineTreeView.Size = New Size(200, 200)
    
    lineTreeView.LineColor = Color.Red
    
    ' Create the root nodes.
    Dim docNode As New TreeNode("Documents")
    
    ' Add some additional nodes.
    docNode.Nodes.Add("phoneList.doc")
    docNode.Nodes.Add("resume.doc")
    
    lineTreeView.Nodes.Add(docNode)
    Controls.Add(lineTreeView)

End Sub

Se aplica a