[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'ShellCtrls' (#lcl)

TCustomShellListView.AdjustColWidths

Adjusts the width of columns in the list view according to the overall width for the control.

Declaration

Source position: shellctrls.pas line 279

protected procedure TCustomShellListView.AdjustColWidths;

Description

AdjustColWidths is a method used to adjust the width of columns according to the overall width for the control. It ensures that the columns are proportionately sized in the control layout.

No actions are performed in the method when the control has fewer than three (3) columns, or when AutoSizeColumns is False and an explicit value has been assigned to the first column in the control.

An arbitrary width of 400 pixels is used to determine the adjusted width for each of the columns.

Width < 400 pixels
The initial column is give 50% of the overall client width, and the second column is given 25% of the overall client width.The third column is given the remaining client area for the control.
Width >= 400 pixels
The initial column is give 70% of the overall width, and the second column is given 15% of the overall width. The third column is given the remaining client area for the control, or 0 when no space is available.

If the control has more than three columns, the widths for the remaining columns are not altered.

AdjustColWidths calls BeginUpdate prior to updating the column widths, and calls EndUpdate when column layout has been updated.

AdjustColWidths is called from the Create constructor, from the DoOnResize method, and when a new value is assigned to AutoSizeColumns property.

See also

TCustomShellListView.AutoSizeColumns

  

Indicates if columns in the control are automatically resized to fill the client display area.

TCustomShellListView.Create

  

Constructor for the class instance.

TCustomShellListView.DoOnResize

  

Adjusts column widths when the control is resized.

TControl.ClientWidth

  

The width of the client area for the control.

TCustomListView.Columns

  

Collection with the column definitions for the list view control (size, alignment, image index, etc.).


Version 4.0 Generated 2025-05-03 Home