TreeView.LineColor 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置连接 TreeView 控件的节点的线条的颜色。
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
属性值
连接树节点的线条的 Color。
示例
下面的代码示例演示如何设置 TreeNode 线条颜色。 若要运行此示例,请将代码粘贴到 Windows 窗体中。 从窗体的构造函数或Load事件处理程序调用InitializeLineTreeView
。
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