Export (0) Print
Expand All
Expand Minimize

PartChromeType Enumeration

Specifies the kind of border that surrounds a Web Parts control.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

type PartChromeType

Member nameDescription
BorderOnlyA border only, without a title bar.
DefaultA border setting inherited from the part control's containing zone.
NoneNo border and no title bar.
TitleAndBorderA title bar and a border.
TitleOnlyA title bar only, without a border.

A part control's PartChromeType enumeration determines what kind of border surrounds a Web Parts control. Options include showing a title bar only, a border only, a title bar and border, or neither.

If the enumeration value is set to Default on the ChromeType property of a part control, the control inherits its setting from the PartChromeType property of the zone that contains the control.

The following code examples demonstrate the declarative use of the PartChromeType enumeration by using a custom WebPart control referenced in an ASP.NET Web page. For the code example to run, you must compile this source code. You can compile it explicitly and put the resulting assembly in your Web site's Bin folder or the global assembly cache. Alternatively, you can put the source code in your site's App_Code folder, where it will be dynamically compiled at run time. For a walkthrough that demonstrates both methods of compiling, see Walkthrough: Developing and Using a Custom Web Server Control.

The first part of the example contains the code for the custom control, named TextDisplayWebPart. Because the control derives from WebPart, it also inherits the common properties that the Part class provides, including the ChromeType property, which uses the PartChromeType enumeration as its return type.

No code example is currently available or this language may not be supported.

Note that in the declarative markup for the Web page, the second instance of the TextDisplayWebPart control sets its ChromeType property value to TitleOnly. After you load the page in a browser, the second control instance appears minimized. When you expand the second control, it has only a title bar without a border.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft