TreeView.NoExpandImageUrl プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As TreeView Dim value As String value = instance.NoExpandImageUrl instance.NoExpandImageUrl = 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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTreeView.NoExpandImageUrl プロパティを検索する場合は、下記のリンクをクリックしてください。

- TreeView.NoExpandImageUrl プロパティのページへのリンク