System.Windows.Forms.ColumnHeader.AutoResize Method

Resizes the width of the column as indicated by the resize style.

Syntax

public void AutoResize (ColumnHeaderAutoResizeStyle headerAutoResize)

Parameters

headerAutoResize
One of the System.Windows.Forms.ColumnHeaderAutoResizeStyle values.

Remarks

Calling the ColumnHeader.AutoResize(ColumnHeaderAutoResizeStyle) method is only effective once the System.Windows.Forms.ListView and containing System.Windows.Forms.Form have been constructed, and the column is populated with items. If new items are added to the System.Windows.Forms.ListView, the column will not resize unless ColumnHeader.AutoResize(ColumnHeaderAutoResizeStyle) is called again.

Requirements

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