Part.ChromeState プロパティ
定義
パーツ コントロールが最小化または標準のどちらの状態で表示されるかを示す値を取得または設定します。Gets or sets whether a part control is in a minimized or normal state.
public:
virtual property System::Web::UI::WebControls::WebParts::PartChromeState ChromeState { System::Web::UI::WebControls::WebParts::PartChromeState get(); void set(System::Web::UI::WebControls::WebParts::PartChromeState value); };
public virtual System.Web.UI.WebControls.WebParts.PartChromeState ChromeState { get; set; }
member this.ChromeState : System.Web.UI.WebControls.WebParts.PartChromeState with get, set
Public Overridable Property ChromeState As PartChromeState
プロパティ値
PartChromeState 値のいずれか 1 つ。One of the PartChromeState values. 既定値は、Normal です。The default is Normal.
例外
指定された値が PartChromeState 値ではありません。The value specified is not one of the PartChromeState values.
例
次のコード例は、パーツコントロールのChromeStateプロパティの宣言型の使用方法を示しています。The following code example illustrates the declarative use of the ChromeState property in a part control. この例では、 WebPartカスタムTextDisplayWebPart
コントロールが必要です。これは、 Partクラスの概要の「例」セクションにあります。This example requires the custom WebPart control TextDisplayWebPart
, which can be found in the Example section of the Part class summary.
Web ページの宣言型マークアップでは、 TextDisplayWebPart
コントロールの2番目のインスタンスによってChromeStateプロパティが設定されることに注意してください。Note that in the declarative markup for the Web page, the second instance of the TextDisplayWebPart
control sets its ChromeState property. ブラウザーにページを読み込むと、2番目のコントロールインスタンスが最小化された状態で表示されます。After you load the page in a browser, the second control instance appears minimized.
<%@ page language="C#" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.CS.Controls"
Assembly="TextDisplayWebPartCS" %>
<!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 id="Head1" runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:webpartmanager id="WebPartManager1" runat="server" />
<asp:webpartzone
id="WebPartZone1"
runat="server"
backcolor="#99cccc">
<parttitlestyle font-bold="true" forecolor="#ffffff" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<aspSample:TextDisplayWebPart
runat="server"
id="textwebpart"
title = "Text Content WebPart"
Description="A text content WebPart control."
ChromeType="TitleAndBorder"
width="350px" />
</zonetemplate>
</asp:webpartzone>
<asp:webpartzone
id="WebPartZone2"
runat="server"
backcolor="#99cccc">
<parttitlestyle font-bold="true" forecolor="#ffffff" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<aspSample:TextDisplayWebPart
runat="server"
id="textwebpart2"
title = "Text Content WebPart 2"
Description="A text content WebPart control."
ChromeType="TitleOnly"
ChromeState="Minimized"
width="350px" />
</zonetemplate>
</asp:webpartzone>
</form>
</body>
</html>
<%@ page language="VB" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.VB.Controls"
Assembly="TextDisplayWebPartVB" %>
<!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 id="Head1" runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:webpartmanager id="WebPartManager1" runat="server" />
<asp:webpartzone
id="WebPartZone1"
runat="server"
backcolor="#99cccc">
<parttitlestyle font-bold="true" forecolor="#ffffff" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<aspSample:TextDisplayWebPart
runat="server"
id="textwebpart"
title = "Text Content WebPart"
Description="A text content WebPart control."
ChromeType="TitleAndBorder"
width="350px" />
</zonetemplate>
</asp:webpartzone>
<asp:webpartzone
id="WebPartZone2"
runat="server"
backcolor="#99cccc">
<parttitlestyle font-bold="true" forecolor="#ffffff" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<aspSample:TextDisplayWebPart
runat="server"
id="textwebpart2"
title = "Text Content WebPart 2"
Description="A text content WebPart control."
ChromeType="TitleOnly"
ChromeState="Minimized"
width="350px" />
</zonetemplate>
</asp:webpartzone>
</form>
</body>
</html>
注釈
パーツコントロールChromeStateは、通常の場合も最小化されている場合もあります。A part control's ChromeState can be normal or minimized.
注意 (継承者)
などの派生クラスWebPartは、 ChromeStateコントロールの境界線の状態をユーザーがパーソナル化できるようにオーバーライドできます。Derived classes such as WebPart can override ChromeState to enable user personalization of the control's border state.