|
|
|
SftBoxColumn.MakeOptimal Method |
Sets the column's optimal width.
Syntax
VB.NET |
object.MakeOptimal(ByVal MaxScan As Integer) |
||
VB |
object.MakeOptimal(ByVal MaxScan As Long) |
||
C#.NET |
void object.MakeOptimal(int MaxScan); |
||
VC++ |
HRESULT object->MakeOptimal(long MaxScan); |
||
C |
HRESULT object->raw_MakeOptimal(long MaxScan); |
||
Delphi |
procedure object.MakeOptimal(MaxScan : Integer); |
object
A SftBoxColumn object.
MaxScan
The maximum number of items analyzed to determine the optimal column width for the column described by object. If 0 is specified, all items will be considered.
Comments
The MakeOptimal method sets the column's optimal width.
This method resizes the column described by object to the optimal width so that the column header and each cell can be completely displayed without being truncated or clipped. The Column.CalcOptimalWidth method can be used to calculate a column's optimal width without resizing the column. The column width can be changed using the Column.Width property.
The Columns.MakeOptimal method can be used to resize all columns.
By changing control properties, the optimal column width may change. Adding items, setting new cell graphics and changing cell text are a few of the actions that can affect the optimal column width. The column width may have to be set again to allow items to be completely visible. The control does not automatically adjust column widths.
If items are not visible because their parent items are collapsed, these are always excluded from the optimal width calculation.
The combo box control does not automatically adjust column widths.
The last (or only) column may be an "open-ended" column. The Columns.OpenEnded property is set to True. An open-ended column will always use the space remaining between the previous column and the right edge of the control window.
Calculating the optimal column width can be a time consuming operation, particularly if many items have been added to the control. Column.MakeOptimal scans all items to determine the best column width, but can be limited to a specific number of items using the MaxScan argument. This reduces the time spent to calculate the optimal width, but may still leave some items clipped.