Part.ChromeState Property
.NET Framework 3.0
Gets or sets whether a part control is in a minimized or normal state.
Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public: virtual property PartChromeState ChromeState { PartChromeState get (); void set (PartChromeState value); }
/** @property */ public PartChromeState get_ChromeState () /** @property */ public void set_ChromeState (PartChromeState value)
public function get ChromeState () : PartChromeState public function set ChromeState (value : PartChromeState)
Not applicable.
Property Value
One of the PartChromeState values. The default is Normal.A part control's ChromeState can be normal or minimized.
Notes to Inheritors: Derived classes such as WebPart can override ChromeState to enable user personalization of the control's border state.The following code example illustrates the declarative use of the ChromeState property in a part control. This example requires the custom WebPart control TextDisplayWebPart, which can be found in the Example section of the Part class summary.
Note that in the declarative markup for the Web page, the second instance of the TextDisplayWebPart control sets its ChromeState property. After you load the page in a browser, the second control instance appears minimized.
<%@ page language="VJ#" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.JSL.Controls"
Assembly="TextDisplayWebPartJSL" %>
<!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>
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: