WebPartZoneBase.SelectedPartChromeStyle プロパティ

定義

ゾーン内の選択した WebPart コントロールの外観のスタイル情報を取得します。

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

プロパティ値

選択した Style コントロールのスタイル情報を含む WebPart

属性

次のコード例では、コントロールで プロパティを SelectedPartChromeStyle 宣言的に使用する方法を WebPartZone 示します。 分離コード ソース ファイルや、このコードのゾーンを含む .aspx ページなど、完全なコード例については、クラスの概要に関するページを WebPartZoneBase 参照してください。

プロパティには SelectedPartChromeStyle 、宣言型マークアップで値が割り当てられていることに注意してください。 この値は に影響します WebPartZone1。 ブラウザーにページを読み込んだ後、ページを編集モードに切り替えます。 いずれかの WebPart コントロールの動詞メニューで、動詞をクリックしてコントロールを編集し、コントロールの背景色が宣言型マークアップで割り当てられた色に変わります。

<asp:WebPartZone 
  ID="WebPartZone1" 
  Runat="server"
  LayoutOrientation="Vertical" >
  <EditVerb Text="Edit WebPart" />
  <SelectedPartChromeStyle BackColor="LightBlue" />
  <ZoneTemplate>
    <asp:BulletedList 
      ID="BulletedList1" 
      Runat="server"
      DisplayMode="HyperLink" 
      Title="Favorite Links" >
      <asp:ListItem Value="http://msdn.microsoft.com">
        MSDN
      </asp:ListItem>
      <asp:ListItem Value="http://www.asp.net">
        ASP.NET
      </asp:ListItem>
      <asp:ListItem Value="http://www.msn.com">
        MSN
      </asp:ListItem>
    </asp:BulletedList>
    <asp:Calendar ID="Calendar1" Runat="server" 
      Title="My Calendar" />
  </ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone 
  ID="WebPartZone1" 
  Runat="server"
  LayoutOrientation="Vertical" >
  <EditVerb Text="Edit WebPart" />
  <SelectedPartChromeStyle BackColor="LightBlue" />
  <ZoneTemplate>
    <asp:BulletedList 
      ID="BulletedList1" 
      Runat="server"
      DisplayMode="HyperLink" 
      Title="Favorite Links" >
      <asp:ListItem Value="http://msdn.microsoft.com">
        MSDN
      </asp:ListItem>
      <asp:ListItem Value="http://www.asp.net">
        ASP.NET
      </asp:ListItem>
      <asp:ListItem Value="http://www.msn.com">
        MSN
      </asp:ListItem>
    </asp:BulletedList>
    <asp:Calendar ID="Calendar1" Runat="server" 
      Title="My Calendar" />
  </ZoneTemplate>
</asp:WebPartZone>

注釈

SelectedPartChromeStyleプロパティを使用すると、Web パーツ ページが編集モードのときに、ゾーン内の選択したWebPartコントロールのスタイル特性にアクセスできます。

適用対象

こちらもご覧ください