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 Form 中。 從表單的建構函式或 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