TreeNodeStyleCollectionとは? わかりやすく解説

TreeNodeStyleCollection クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

TreeView コントロール内の TreeNodeStyle オブジェクトコレクション表します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 TreeNodeStyleCollection
    Inherits StateManagedCollection
Dim instance As TreeNodeStyleCollection
public sealed class TreeNodeStyleCollection
 : StateManagedCollection
public ref class TreeNodeStyleCollection sealed
 : public StateManagedCollection
public final class TreeNodeStyleCollection
 extends StateManagedCollection
public final class TreeNodeStyleCollection
 extends StateManagedCollection
解説解説
使用例使用例

TreeNodeStyleCollection クラス使用してTreeView コントロールの各レベルに対してスタイル設定個別指定するコード例次に示しますLevelStyles プロパティは、TreeNodeStyleCollection オブジェクト返します

<%@ Page Language="VB" %>

<html>

  <body>
    <form runat="server">
    
      <h3>TreeView LevelStyles Example</h3>

      <!-- Populate the LevelStyles collection of the TreeView
 control -->
      <!-- declaratively.                                              -->
      
      <asp:TreeView id="LinksTreeView"
        Font-Name= "Arial"
        ForeColor="Blue"
        ShowExpandCollapse="false"
        InitialExpandDepth="3"
        NodeIndent="0" 
        runat="server">
         
        <LevelStyles>
        
          <asp:TreeNodeStyle ChildNodesPadding="10"
 
            Font-Bold="true" 
            Font-Size="12pt" 
            ForeColor="DarkGreen"/>
          <asp:TreeNodeStyle ChildNodesPadding="5"
 
            Font-Bold="true" 
            Font-Size="10pt"/>
          <asp:TreeNodeStyle ChildNodesPadding="5"
 
            Font-UnderLine="true" 
            Font-Size="10pt"/>
          <asp:TreeNodeStyle ChildNodesPadding="10"
 
            Font-Size="8pt"/>
             
        </LevelStyles>
         
        <Nodes>
        
          <asp:TreeNode Text="Table of Contents"
            SelectAction="None">
             
            <asp:TreeNode Text="Chapter One">
            
              <asp:TreeNode Text="Section 1.0">
              
                <asp:TreeNode Text="Topic 1.0.1"/>
                <asp:TreeNode Text="Topic 1.0.2"/>
                <asp:TreeNode Text="Topic 1.0.3"/>
              
              </asp:TreeNode>
              
              <asp:TreeNode Text="Section 1.1">
              
                <asp:TreeNode Text="Topic 1.1.1"/>
                <asp:TreeNode Text="Topic 1.1.2"/>
                <asp:TreeNode Text="Topic 1.1.3"/>
                <asp:TreeNode Text="Topic 1.1.4"/>
              
              </asp:TreeNode>
            
            </asp:TreeNode>
            
            <asp:TreeNode Text="Chapter Two">
            
              <asp:TreeNode Text="Section 2.0">
              
                <asp:TreeNode Text="Topic 2.0.1"/>
                <asp:TreeNode Text="Topic 2.0.2"/>
              
              </asp:TreeNode>
            
            </asp:TreeNode>
            
          </asp:TreeNode>
          <asp:TreeNode Text="Appendix A" />
          <asp:TreeNode Text="Appendix B" />
          <asp:TreeNode Text="Appendix C" />
        
        </Nodes>
        
      </asp:TreeView>

    </form>
  </body>
</html>

<%@ Page Language="C#" %>

<html>

  <body>
    <form runat="server">
    
      <h3>TreeView LevelStyles Example</h3>

      <!-- Populate the LevelStyles collection of the TreeView control -->
      <!-- declaratively.                                              -->
      
      <asp:TreeView id="LinksTreeView"
        Font-Name= "Arial"
        ForeColor="Blue"
        ShowExpandCollapse="false"
        InitialExpandDepth="3"
        NodeIndent="0" 
        runat="server">
         
        <LevelStyles>
        
          <asp:TreeNodeStyle ChildNodesPadding="10" 
            Font-Bold="true" 
            Font-Size="12pt" 
            ForeColor="DarkGreen"/>
          <asp:TreeNodeStyle ChildNodesPadding="5" 
            Font-Bold="true" 
            Font-Size="10pt"/>
          <asp:TreeNodeStyle ChildNodesPadding="5" 
            Font-UnderLine="true" 
            Font-Size="10pt"/>
          <asp:TreeNodeStyle ChildNodesPadding="10" 
            Font-Size="8pt"/>
             
        </LevelStyles>
         
        <Nodes>
        
          <asp:TreeNode Text="Table of Contents"
            SelectAction="None">
             
            <asp:TreeNode Text="Chapter One">
            
              <asp:TreeNode Text="Section 1.0">
              
                <asp:TreeNode Text="Topic 1.0.1"/>
                <asp:TreeNode Text="Topic 1.0.2"/>
                <asp:TreeNode Text="Topic 1.0.3"/>
              
              </asp:TreeNode>
              
              <asp:TreeNode Text="Section 1.1">
              
                <asp:TreeNode Text="Topic 1.1.1"/>
                <asp:TreeNode Text="Topic 1.1.2"/>
                <asp:TreeNode Text="Topic 1.1.3"/>
                <asp:TreeNode Text="Topic 1.1.4"/>
              
              </asp:TreeNode>
            
            </asp:TreeNode>
            
            <asp:TreeNode Text="Chapter Two">
            
              <asp:TreeNode Text="Section 2.0">
              
                <asp:TreeNode Text="Topic 2.0.1"/>
                <asp:TreeNode Text="Topic 2.0.2"/>
              
              </asp:TreeNode>
            
            </asp:TreeNode>
            
          </asp:TreeNode>
          <asp:TreeNode Text="Appendix A" />
          <asp:TreeNode Text="Appendix B" />
          <asp:TreeNode Text="Appendix C" />
        
        </Nodes>
        
      </asp:TreeView>

    </form>
  </body>
</html>

継承階層継承階層
System.Object
   System.Web.UI.StateManagedCollection
    System.Web.UI.WebControls.TreeNodeStyleCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeNodeStyleCollection メンバ
System.Web.UI.WebControls 名前空間
TreeView
StyleCollection クラス
LevelStyles

TreeNodeStyleCollection プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Count  StateManagedCollection コレクション格納されている要素の数を取得します。 ( StateManagedCollection から継承されます。)
パブリック プロパティ Item TreeNodeStyleCollection オブジェクト内の指定したインデックス位置にある TreeNodeStyle オブジェクト取得または設定します
参照参照

関連項目

TreeNodeStyleCollection クラス
System.Web.UI.WebControls 名前空間
TreeView
StyleCollection クラス
LevelStyles

TreeNodeStyleCollection メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した TreeNodeStyle オブジェクトを TreeNodeStyleCollection オブジェクト末尾追加します
パブリック メソッド Clear  StateManagedCollection コレクションからすべての項目を削除します。 ( StateManagedCollection から継承されます。)
パブリック メソッド Contains 指定した TreeNodeStyle オブジェクトコレクション内にあるかどうか確認します
パブリック メソッド CopyTo オーバーロードされますTreeNodeStyleCollection オブジェクトからすべての項目をコピーします
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetEnumerator  StateManagedCollection コレクション反復処理する反復子返します。 ( StateManagedCollection から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IndexOf コレクション内の指定した TreeNodeStyle オブジェクトインデックス確認します
パブリック メソッド Insert 指定した TreeNodeStyle オブジェクトTreeNodeStyleCollection オブジェクト指定したインデックス位置挿入します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド Remove 指定した TreeNodeStyle オブジェクトTreeNodeStyleCollection オブジェクトから削除します
パブリック メソッド RemoveAt 指定したインデックス位置にある TreeNodeStyle オブジェクトTreeNodeStyleCollection オブジェクトから削除します
パブリック メソッド SetDirty  強制的に StateManagedCollection コレクション全体ビューステートシリアル化ます。 ( StateManagedCollection から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

TreeNodeStyleCollection クラス
System.Web.UI.WebControls 名前空間
TreeView
StyleCollection クラス
LevelStyles

TreeNodeStyleCollection メンバ

TreeView コントロール内の TreeNodeStyle オブジェクトコレクション表します

TreeNodeStyleCollection データ型公開されるメンバを以下の表に示します


パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Count  StateManagedCollection コレクション格納されている要素の数を取得します。(StateManagedCollection から継承されます。)
パブリック プロパティ Item TreeNodeStyleCollection オブジェクト内の指定したインデックス位置にある TreeNodeStyle オブジェクト取得または設定します
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した TreeNodeStyle オブジェクトを TreeNodeStyleCollection オブジェクト末尾追加します
パブリック メソッド Clear  StateManagedCollection コレクションからすべての項目を削除します。 (StateManagedCollection から継承されます。)
パブリック メソッド Contains 指定した TreeNodeStyle オブジェクトコレクション内にあるかどうか確認します
パブリック メソッド CopyTo オーバーロードされますTreeNodeStyleCollection オブジェクトからすべての項目をコピーします
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetEnumerator  StateManagedCollection コレクション反復処理する反復子返します。 (StateManagedCollection から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IndexOf コレクション内の指定した TreeNodeStyle オブジェクトインデックス確認します
パブリック メソッド Insert 指定した TreeNodeStyle オブジェクトTreeNodeStyleCollection オブジェクト指定したインデックス位置挿入します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド Remove 指定した TreeNodeStyle オブジェクトTreeNodeStyleCollection オブジェクトから削除します
パブリック メソッド RemoveAt 指定したインデックス位置にある TreeNodeStyle オブジェクトTreeNodeStyleCollection オブジェクトから削除します
パブリック メソッド SetDirty  強制的に StateManagedCollection コレクション全体ビューステートシリアル化ます。 (StateManagedCollection から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

TreeNodeStyleCollection クラス
System.Web.UI.WebControls 名前空間
TreeView
StyleCollection クラス
LevelStyles


このページでは「.NET Framework クラス ライブラリ リファレンス」からTreeNodeStyleCollectionを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTreeNodeStyleCollectionを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTreeNodeStyleCollection を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TreeNodeStyleCollection」の関連用語

TreeNodeStyleCollectionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TreeNodeStyleCollectionのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS