Share via


SiteMapPath.CurrentNodeStyle プロパティ

定義

現在のノードの表示テキストに使用されるスタイルを取得します。

public:
 property System::Web::UI::WebControls::Style ^ CurrentNodeStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style CurrentNodeStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.CurrentNodeStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property CurrentNodeStyle As Style

プロパティ値

Style

Style コントロールの現在のノードの表示テキストに対するスタイル設定を格納する SiteMapPath

属性

次のコード例は、Web Forms ページでコントロールのSiteMapPath宣言によって設定CurrentNodeStyleする方法を示しています。

<%@ 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>ASP.NET Example</title>
</head>
<body>
    <form id="Form1" method="post" runat="server">

      <p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
            RootNodeStyle-Font-Bold="true"
            RootNodeStyle-Font-Names="Arial Black"
            RootNodeStyle-Font-Italic="True"
            RootNodeStyle-ForeColor="Green"
            CurrentNodeStyle-ForeColor="Orange"/></p>

      <p><asp:Label
            id="Label1"
            runat="server"
            Width="441px"
            Height="64px"
            AssociatedControlID="TextBox1">
                Enter your customer service issue in the space
                provided below, and we will get back to you as
                soon as possible.</asp:Label></p>

      <p><asp:TextBox id="TextBox1" runat="server"
          Width="448px" Height="96px"></asp:TextBox></p>

      <p><asp:Button id="Button1" runat="server"
          Width="112px" Text="Submit"></asp:Button></p>
    </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>ASP.NET Example</title>
</head>
<body>
    <form id="Form1" method="post" runat="server">

      <p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
            RootNodeStyle-Font-Bold="true"
            RootNodeStyle-Font-Names="Arial Black"
            RootNodeStyle-Font-Italic="True"
            RootNodeStyle-ForeColor="Green"
            CurrentNodeStyle-ForeColor="Orange"/></p>

      <p><asp:Label
            id="Label1"
            runat="server"
            Width="441px"
            AssociatedControlID="TextBox1"
            Height="64px">Enter your customer service issue in the space
                          provided below, and we will get back to you as
                          soon as possible.</asp:Label></p>

      <p><asp:TextBox id="TextBox1" runat="server"
          Width="448px" Height="96px"></asp:TextBox></p>

      <p><asp:Button id="Button1" runat="server"
          Width="112px" Text="Submit"></asp:Button></p>
    </form>
  </body>
</html>

注釈

プロパティを CurrentNodeStyle 使用して、現在表示されているページを表すナビゲーション パス ノードの表示テキストの外観を制御します。 既定では、表示テキストは、ページを Title 表すプロパティ SiteMapNode で指定されます。 一般的なスタイル設定には、カスタム背景色、前景色、フォント プロパティ、ノード間隔などがあります。

ノードの場合 SiteMapPath 、スタイル プロパティは次の順序で 1 つのスタイルにマージされます。

  1. NodeStyle

  2. CurrentNodeStyle または、現在表示されているページがルート ノードの場合は、 RootNodeStyle.

注意

ノードのフォント スタイルを取り消し線またはオーバーライン スタイルに設定した場合、ノードの既定の下線スタイルは、明示的に設定 trueされていない限り表示されません。

プロパティが CurrentNodeTemplate 定義されている場合、 CurrentNodeStyle プロパティは無視されます。

適用対象

こちらもご覧ください