System.Windows.Forms.ListView.AutoResizeColumns Method

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

Syntax

public void AutoResizeColumns (ColumnHeaderAutoResizeStyle headerAutoResize)

Parameters

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

Remarks

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

Requirements

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