TreeView.NodeStyle 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤에서 노드의 TreeNodeStyle 기본 모양을 설정할 수 있는 개체에 대한 참조를 TreeView 가져옵니다.
public:
property System::Web::UI::WebControls::TreeNodeStyle ^ NodeStyle { System::Web::UI::WebControls::TreeNodeStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TreeNodeStyle NodeStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.NodeStyle : System.Web.UI.WebControls.TreeNodeStyle
Public ReadOnly Property NodeStyle As TreeNodeStyle
속성 값
노드의 TreeNodeStyle 기본 스타일을 나타내는 참조입니다.
- 특성
예제
다음 코드 예제에서는 컨트롤에서 NodeStyle 노드의 모양을 제어 하는 속성을 사용 하는 방법을 보여 줍니다 TreeView .
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>TreeView NodeStyle Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>TreeView NodeStyle Example</h3>
<!-- Declaratively set the NodeStyle settings. -->
<asp:TreeView id="LinksTreeView"
NodeStyle-ForeColor="Green"
NodeStyle-VerticalPadding="0"
runat="server">
<Nodes>
<asp:TreeNode Value="Home"
NavigateUrl="Home.aspx"
Text="Home"
Target="Content"
Expanded="True">
<asp:TreeNode Value="Page 1"
NavigateUrl="Page1.aspx"
Text="Page1"
Target="Content">
<asp:TreeNode Value="Section 1"
NavigateUrl="Section1.aspx"
Text="Section 1"
Target="Content"/>
</asp:TreeNode>
<asp:TreeNode Value="Page 2"
NavigateUrl="Page2.aspx"
Text="Page 2"
Target="Content">
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>TreeView NodeStyle Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>TreeView NodeStyle Example</h3>
<!-- Declaratively set the NodeStyle settings. -->
<asp:TreeView id="LinksTreeView"
NodeStyle-ForeColor="Green"
NodeStyle-VerticalPadding="0"
runat="server">
<Nodes>
<asp:TreeNode Value="Home"
NavigateUrl="Home.aspx"
Text="Home"
Target="Content"
Expanded="True">
<asp:TreeNode Value="Page 1"
NavigateUrl="Page1.aspx"
Text="Page1"
Target="Content">
<asp:TreeNode Value="Section 1"
NavigateUrl="Section1.aspx"
Text="Section 1"
Target="Content"/>
</asp:TreeNode>
<asp:TreeNode Value="Page 2"
NavigateUrl="Page2.aspx"
Text="Page 2"
Target="Content">
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>
설명
컨트롤에서 NodeStyle 노드 TreeView 의 기본 모양을 제어 하려면 속성을 사용 합니다. 이 속성은 읽기 전용입니다. 그러나 반환하는 개체의 TreeNodeStyle 속성을 설정할 수 있습니다. 속성은 개체의 TreeNodeStyle 속성(예NodeStyle-ForeColor: )인 형식 Property-SubpropertySubproperty 에서 선언적으로 설정할 수 있습니다. 속성은 양식 Property.Subproperty 에서 프로그래밍 방식으로 설정할 수도 있습니다(예: NodeStyle.ForeColor). 일반적인 설정에는 일반적으로 사용자 지정 배경색, 전경색, 글꼴 속성 및 노드 간격이 포함됩니다. 스타일 속성은 다음 우선 순위 순서로 적용됩니다.
RootNodeStyle, ParentNodeStyle또는 LeafNodeStyle노드 유형에 따라 다릅니다. 컬렉션이 LevelStyles 정의되면 이때 적용되어 다른 노드 스타일 속성을 재정의합니다.
메모
또는 속성의 RootNodeStyleParentNodeStyle해당 노드 스타일 설정이 속성의 스타일 설정을 재정의합니다NodeStyle.LeafNodeStyle
자식 노드가 있는지 여부에 관계없이 특정 수준의 노드가 동일한 모양을 가져야 하는 목차 스타일 탐색 메뉴 테이블을 생성해야 하는 경우 개별 스타일 속성을 설정하는 대신 속성을 사용하는 LevelStyles 것이 좋습니다.