SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Calculates the row header area's optimal width so that the cell contents in the row header area can be displayed without being clipped horizontally.
Class: RowHeadersClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET
public int GetOptimalWidth( int MaxScan, bool VisibleOnly );
Public Function GetOptimalWidth( ByVal MaxScan As Integer, ByVal VisibleOnly As Boolean ) As Integer
MaxScan
Defines the maximum number of items to scan to determine the optimal row header area width or 0 to scan all items.
VisibleOnly
Defines whether only visible items should be considered to determine the optimal row header area width. Visible items are items whose parent items are expanded.
Returns the row header area's optimal width so that the cell contents in the row header area can be displayed without being clipped horizontally.
Calculates the row header area's optimal width so that the cell contents in the row header area can be displayed without being clipped horizontally.
This method calculates the optimal row header area width so that each cell in the row header area can be completely displayed without being truncated or clipped. The RowHeadersClass.MakeOptimal method can be used to resize the row header area to its optimal width. The row header area width can be changed using the RowHeadersClass.Width property.
By changing tree control properties, the optimal row header area width may change. Adding items, setting new cell contents are a few of the actions that can affect the optimal row header area width. The row header area width may have to be set again to allow cells to be completely visible.
The tree control does not automatically adjust the row header area width.
Calculating the optimal row header area width can be a time consuming operation, particularly if many items have been added to the tree control. The MaxScan parameter can be used to limit the maximum number of items to consider for optimal row header area width calculation. MakeOptimal scans all items to determine the best row header area width, but can be limited to a specific number of items using the MaxScan parameter. This reduces the time spent to calculate the optimal width, but may still leave some items clipped.
If items are not visible because their parent items are collapsed, these can be excluded from the optimal width calculation by setting the VisibleOnly parameter to True.
Individual row headers can be excluded from the optimal width calculation by setting their RowHeaderClass.WidthIgnore property.
See Also RowHeadersClass Class | Classes | SftTree/NET 2.0