ColumnStyle.Width Property

 

Gets or sets the width value for a column.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member Width : float32 with get, set

Property Value

Type: System.Single

The preferred width, in pixels or percentage, depending on the SizeType property.

Exception Condition
ArgumentOutOfRangeException

The value is less than 0 when setting this property.

The width parameter will take on different meanings depending on the SizeType property.

sizeType value

width interpretation

Absolute

The preferred column width in pixels (fractional portion ignored).

AutoSize

Not applicable—the width parameter is ignored.

Percent

The preferred column width as a percentage of the containing table.

.NET Framework
Available since 2.0
Return to top
Show: