Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxRowHeaders.CalcOptimalWidth Method

Returns the row header area's optimal width.

Syntax

VB.NETWidth = object.CalcOptimalWidth(ByVal MaxScan As Integer) As Single
VBWidth = object.CalcOptimalWidth(ByVal MaxScan As Long) As Single
C#.NETfloat Width = object.CalcOptimalWidth(int MaxScan);
VC++float Width = object->CalcOptimalWidth(long MaxScan);
CHRESULT object->raw_CalcOptimalWidth(long MaxScan, float* Width);

object

A SftBoxRowHeaders object.

MaxScan

The maximum number of items analyzed to determine the optimal row header width. If 0 is specified, all items will be considered.

Width

Returns the optimal row header width. The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.

Comments

The CalcOptimalWidth method returns the row header area's optimal width.

The CalcOptimalWidth and RowHeaders.CalcOptimalWidthPix methods are synonyms, but may use different coordinate systems.

This method calculates the optimal width of the row header so that the row header text and graphics can be completely displayed without being truncated or clipped. The row header width can be changed using the RowHeaders.Width property. The RowHeaders.MakeOptimal method can be used to set the optimal width without having to calculate it first.

By changing control properties, the optimal row header width may change. Adding items, setting new row header attributes can affect the optimal row header width. The row header may have to be set again to allow row headers to be completely visible. The control does not automatically adjust the row header width.

Calculating the optimal row header width can be a time consuming operation, particularly if many items have been added to the control. CalcOptimalWidth scans all items to determine the best row header 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.

See Also SftBoxRowHeaders Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.