TreeView.NoExpandImageUrl プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TreeView.NoExpandImageUrl プロパティの意味・解説 

TreeView.NoExpandImageUrl プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

展開不能なノード インジケータのカスタム イメージの URL を取得または設定します。

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

Public Property NoExpandImageUrl As
 String
Dim instance As TreeView
Dim value As String

value = instance.NoExpandImageUrl

instance.NoExpandImageUrl = value
public string NoExpandImageUrl { get;
 set; }
public:
property String^ NoExpandImageUrl {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_NoExpandImageUrl ()

/** @property */
public void set_NoExpandImageUrl (String value)
public function get NoExpandImageUrl
 () : String

public function set NoExpandImageUrl
 (value : String)

プロパティ値
展開不能なノードに表示されるカスタム イメージの URL。既定値は空の文字列 ("") で、既定の空のイメージを表示します。

解説解説

NoExpandImageUrl プロパティを使用して、展開不能なノード インジケータのカスタム イメージを指定します。展開不能なノード インジケータ イメージ (スペーサ) は、葉ノードを親ノードまたはルート ノードに揃えて配置するために、展開可能および折りたたみ可能なノード インジケータの代わりに葉ノードの隣に表示されます。

ShowExpandCollapse プロパティが true に設定されている場合、TreeView コントロールでは、正符号 (+)、マイナス記号 (-)、またはプレースホルダ イメージがノードの隣に表示され、ノードがそれぞれ展開可能、折りたたみ可能、または展開不能のいずれであるかを示します。ImageSet プロパティを TreeViewImageSet.Custom に設定してから、NoExpandImageUrl、ExpandImageUrl、および CollapseImageUrl の各プロパティをカスタム イメージの URL に設定することにより、カスタム イメージを指定できます。イメージが指定されていない場合は、既定のイメージが使用されます。ノード展開インジケータを非表示にするには、ShowExpandCollapse プロパティを false に設定します。

メモメモ

カスタム イメージを使用するときに TreeView コントロール内のノードを適切に配置するには、NoExpandImageUrl、ExpandImageUrl、および CollapseImageUrl の各プロパティによって指定されたすべてのイメージが同じ大きさであることを確認します。

このプロパティの値はビューステートに格納されます。

使用例使用例

NoExpandImageUrl プロパティを使用して、展開不能なノード インジケータのカスタム イメージを指定するコード例を次に示します。表示するコード例とコントロールに表示されるイメージについて、独自のイメージを指定して、ImageSet プロパティを TreeNodeImageSet.Custom に設定する必要があります。

<%@ Page Language="VB" %>

<html>
  <body>
    <form runat="server">
    
      <h3>TreeView Custom Images Example</h3>
      
      <!-- Set the custom images of this
 TreeView control -->
      <!-- declaratively.                                 -->
      <asp:TreeView id="CustomTreeView"
        NoExpandImageUrl="Space.jpg"
        CollapseImageUrl="Minus.jpg"
        CollapseImageToolTip="Collapse Node"
        ExpandImageUrl="Plus.jpg"
        ExpandImageToolTip="Expand Node"
        RootNodeImageUrl="Root.jpg"
        ParentNodeImageUrl="Parent.jpg"
        LeafNodeImageUrl="Leaf.jpg" 
        ImageSet="Custom"
        runat="server">
         
        <Nodes>
        
          <asp:TreeNode Value="Home" 
            NavigateUrl="Home.aspx" 
            Text="Home"
            Target="_blank" 
            Expanded="True">
             
            <asp:TreeNode Value="Page 1" 
              NavigateUrl="Page1.aspx" 
              Text="Page 1"
              Target="_blank">
                 
              <asp:TreeNode Value="Section 1"
                ImageUrl="custom.jpg" 
                NavigateUrl="Section1.aspx" 
                Text="Section 1"
                Target="_blank">
              </asp:TreeNode>
                
            </asp:TreeNode>
            
            <asp:TreeNode Value="Page 2" 
              Selected="True" 
              NavigateUrl="Page2.aspx"
              Text="Page 2"
              Target="_blank">
            </asp:TreeNode>
            
          </asp:TreeNode>
        
        </Nodes>
        
      </asp:TreeView> 
       

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

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

<html>
  <body>
    <form runat="server">
    
      <h3>TreeView Custom Images Example</h3>
      
      <!-- Set the custom images of this TreeView control -->
      <!-- declaratively.                                 -->
      <asp:TreeView id="CustomTreeView"
        NoExpandImageUrl="Space.jpg"
        CollapseImageUrl="Minus.jpg"
        CollapseImageToolTip="Collapse Node"
        ExpandImageUrl="Plus.jpg"
        ExpandImageToolTip="Expand Node"
        RootNodeImageUrl="Root.jpg"
        ParentNodeImageUrl="Parent.jpg"
        LeafNodeImageUrl="Leaf.jpg" 
        ImageSet="Custom"
        runat="server">
         
        <Nodes>
        
          <asp:TreeNode Value="Home" 
            NavigateUrl="Home.aspx" 
            Text="Home"
            Target="_blank" 
            Expanded="True">
             
            <asp:TreeNode Value="Page 1" 
              NavigateUrl="Page1.aspx" 
              Text="Page 1"
              Target="_blank">
                 
              <asp:TreeNode Value="Section 1"
                ImageUrl="custom.jpg" 
                NavigateUrl="Section1.aspx" 
                Text="Section 1"
                Target="_blank">
              </asp:TreeNode>
                
            </asp:TreeNode>
            
            <asp:TreeNode Value="Page 2" 
              Selected="True" 
              NavigateUrl="Page2.aspx"
              Text="Page 2"
              Target="_blank">
            </asp:TreeNode>
            
          </asp:TreeNode>
        
        </Nodes>
        
      </asp:TreeView> 
       

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

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeView クラス
TreeView メンバ
System.Web.UI.WebControls 名前空間
ShowExpandCollapse
TreeView.ImageSet プロパティ
TreeViewImageSet
TreeView.CollapseImageUrl プロパティ
TreeView.ExpandImageUrl プロパティ



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「TreeView.NoExpandImageUrl プロパティ」の関連用語

TreeView.NoExpandImageUrl プロパティのお隣キーワード
検索ランキング

   

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



TreeView.NoExpandImageUrl プロパティのページの著作権

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

©2026 GRAS Group, Inc.RSS