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
Sets the optimal row header width so that the text and graphics of all row headers can be displayed without being clipped horizontally.
VB.NET | object.MakeOptimal() |
VB | object.MakeOptimal |
C#.NET | void object.MakeOptimal(); |
VC++ | HRESULT object->MakeOptimal(); |
C | HRESULT object->raw_MakeOptimal(); |
object
A SftTreeRowHeaders object.
The MakeOptimal method sets the optimal row header width so that the text and graphics of all row headers can be displayed without being clipped horizontally.
This method resizes the row header area so that the row headers and row header graphics can be completely displayed without being truncated or clipped. The RowHeaders.OptimalWidth method can be used to calculate the row header area's optimal width without resizing the row header area. The row header width can be changed using the RowHeaders.Width property.
By changing tree control properties, the optimal row header width may change. Adding items, setting new row header graphics and changing row header text are a few of the actions that can affect the optimal row header width. The row header width may have to be set again to allow items to be completely visible. The tree 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 tree control. RowHeaders.OptimalWidth scans all items to determine the best row header width, but can be limited to a specific number of items using the Items.CalcLimit property. 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 Items.CalcVisibleOnly property to True.
Item.MinHeightPix = 300 ' always exactly 300 pixels Item.MaxHeightPix = 300 ' always exactly 300 pixels ' Form Dim f As FormSmall = New FormSmall() AxSftTree1.get_Item(6).Cell(1).AttachContentWindow(f.Handle, SftTreeContentWindowStyleConstants.contentWindowSftTreeKeepSize) AxSftTree1.get_Item(6).Cell(1).Text = "" AxSftTree1.RowHeaders.MakeOptimal() ' Make row header width optimal, so text and pictures are not clipped horizontally. AxSftTree1.ColumnsObj.MakeOptimal() ' Make all columns optimal ' triple the size of the last column AxSftTree1.get_Column(1).WidthPix = AxSftTree1.get_Column(1).WidthPix * 3 AxSftTree1.Items.RecalcHorizontalExtent() ' Update horizontal scrollbar
Dim Cell As SftTreeCell Set Item = SftTree1.Item(5) Set Cell = Item.Cell(1) Cell.AttachContentWindow WebBrowserPictureBox.hWnd, contentWindowSftTreeNone Cell.Text = "" Item.MinHeightPix = 300 ' always exactly 300 pixels Item.MaxHeightPix = 300 ' always exactly 300 pixels SftTree1.RowHeaders.MakeOptimal ' Make row header width optimal, so text and pictures are not clipped horizontally. SftTree1.ColumnsObj.MakeOptimal ' Make all columns optimal ' Form Set SavedForm = New Form2 SftTree1.Item(6).Cell(1).AttachContentWindow SavedForm.hWnd, contentWindowSftTreeKeepSize SftTree1.Item(6).Cell(1).Text = ""
Item.MinHeightPix = 300; // always exactly 300 pixels Item.MaxHeightPix = 300; // always exactly 300 pixels // Form FormSmall f = new FormSmall(); axSftTree1.get_Item(6).get_Cell(1).AttachContentWindow((long)f.Handle, SftTreeContentWindowStyleConstants.contentWindowSftTreeKeepSize); axSftTree1.get_Item(6).get_Cell(1).Text = ""; axSftTree1.RowHeaders.MakeOptimal(); // Make row header width optimal, so text and pictures are not clipped horizontally. axSftTree1.ColumnsObj.MakeOptimal(); // Make all columns optimal // triple the size of the last column axSftTree1.get_Column(1).WidthPix = axSftTree1.get_Column(1).WidthPix * 3; axSftTree1.Items.RecalcHorizontalExtent(); // Update horizontal scrollbar
// Simple Dialog // Create the dialog m_SimpleDialog.Create(IDD_SIMPLEDIALOG, &m_Tree); m_vTree->Item[6]->Cell[1]->Text = _T(""); m_vTree->Item[6]->Cell[1]->AttachContentWindow((int) m_SimpleDialog.m_hWnd, contentWindowSftTreeKeepSize); m_vTree->RowHeaders->MakeOptimal(); // Make row header width optimal, so text and pictures are not clipped horizontally. m_vTree->ColumnsObj->MakeOptimal(); // Make all columns optimal // triple the size of the last column m_vTree->Column[1]->WidthPix = m_vTree->Column[1]->WidthPix * 3; m_vTree->Items->RecalcHorizontalExtent(); // Update horizontal scrollbar
See Also SftTreeRowHeaders Object | Object Hierarchy