共用方式為


WebPart.Height Property

Gets or sets the fixed height for a Web Part on a Web Part Page.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<WebPartStorageAttribute(Storage := Storage.Personal)> _
<PersonalizableAttribute> _
Public Property Height As String
    Get
    Set
'Usage
Dim instance As WebPart
Dim value As String

value = instance.Height

instance.Height = value
[WebPartStorageAttribute(Storage = Storage.Personal)]
[PersonalizableAttribute]
public string Height { get; set; }

Property Value

Type: System.String
A string value that specifies the fixed height of the Web Part. Any height value that is allowed in CSS can be used. The default value is String.Empty.

Remarks

Use this property to restrict the height of a Web Part on a Web Part Page. If this property is not set or if it is set to Empty, the Web Part is allowed to grow to be as big as its content within the limits of the zone that contains it.

The value of string is a number followed by a two-character abbreviation that indicates a unit of measure, for example, 50px for 50 pixels. If no unit of measure is indicated, the number defaults to pixels. The following units of measure are supported:

  • cm (centimeters)

  • in (inches)

  • mm (millimeters)

  • pc (picas)

  • pt (points)

  • px (pixels)

This property can be personalized by individual users. Its WebPartStorageAttribute value is Storage.Personal, which specifies that the property can be stored on a per-user basis. Only users with the Personalize Web Part pages right can set this property. It can be set programmatically, or it can be set through the Web Part task pane in the personal view of the Web-based user interface, or by using a SharePoint Foundation–compatible HTML editor, such as SharePoint Designer.

See Also

Reference

WebPart Class

WebPart Members

Microsoft.SharePoint.WebPartPages Namespace