The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



AutoColWidth


Unit: SDL_replist
Class: TReportListView
Declaration: [1] procedure AutoColWidth (ColNr: longint; IncludeHeader: boolean; Addon: integer);
[2] procedure AutoColWidth (ColNr: longint; IncludeHeader: boolean; Addon, MaxWidth: integer);

The method AutoColWidth adjusts the column width so that every cell of the column ColNr is fully readable. Note, that the optimum width depends on the contents of the cells. The parameter ColNr may assume any value between 1 and the number of available columns, NrOfColumns. The column headers are included in the calculation of the optimum column width if IncludeHeader is set to TRUE. The property Addon defines an additional value which is added to the optimum column width. Addon may be negative (to reduce the column width); however, no column will be displayed using less than 4 pixels.

Version [2] of AutoColWidth allows to restrict the column width to a maximum of MaxWidth pixels.

Hint: Double-clicking on the vertical line between two column headers is equivalent to AutoColWidth (cnum, true, 0), with cnum being the column number of the column left to the mouse position.


Last Update: 2023-Dec-13