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
Resizes all columns to their optimal width.
VB.NET | object.MakeColumnsOptimal() |
VB | object.MakeColumnsOptimal |
C#.NET | void object.MakeColumnsOptimal(); |
VC++ | HRESULT object->MakeColumnsOptimal(); |
C | HRESULT object->raw_MakeColumnsOptimal(); |
object
The MakeColumnsOptimal method resizes all columns to their optimal width.
If the AutoSizeColumns property is set to True, the MakeColumnsOptimal method is automatically invoked by the control when needed.
The Column.MakeOptimal method can be used to optimally resize one column.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' call this to update the buttons UpdateLeftButtons() UpdateRightButtons() AxSftDirectoryRight.MakeColumnsOptimal() End Sub Private Sub AxSftDirectoryLeft_SelectionFinal(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftDirectoryLeft.SelectionFinal ' If the selection in the left tree changes, update right side detaillist UpdateLeftButtons() AxSftDirectoryRight.Clear() AxSftDirectoryRight.CancelMode() AxSftDirectoryRight.Refresh() If Not AxSftDirectoryLeft.CurrentFolder Is Nothing Then AxSftDirectoryRight.TopMostFolderIDL = AxSftDirectoryLeft.CurrentFolder.ItemIDList Else
Private Sub Form_Load() ' call this to update the buttons UpdateLeftButtons UpdateRightButtons SftDirectoryRight.MakeColumnsOptimal End Sub Private Sub SftDirectoryLeft_SelectionFinal() ' If the selection in the left tree changes, update right side detaillist UpdateLeftButtons SftDirectoryRight.Clear SftDirectoryRight.CancelMode SftDirectoryRight.Refresh If Not SftDirectoryLeft.CurrentFolder Is Nothing Then SftDirectoryRight.TopMostFolderIDL = SftDirectoryLeft.CurrentFolder.ItemIDList Else
private void Form1_Load(object sender, System.EventArgs e) { UpdateLeftButtons(); UpdateRightButtons(); axSftDirectoryRight.MakeColumnsOptimal(); } private void UpdateLeftButtons() { // Update the buttons dependent on the left tree SftDirectoryFolder f; // Enable/disable Up button f = axSftDirectoryLeft.CurrentFolder; if (f != null) f = f.Parent; buttonUp.Enabled = (f != null); }
ReleaseDC(pDC); GetDlgItem(IDC_TITLE)->SetFont(&m_FontBig); UpdateLeftButtons(); UpdateRightButtons(); ISftDirectoryPtr vDirRight = m_DirRight.GetControlUnknown(); vDirRight->MakeColumnsOptimal(); vDirRight->PutFont(NULL); vDirRight->Headers->PutFont(NULL); ISftDirectoryPtr vDirLeft = m_DirLeft.GetControlUnknown(); vDirLeft->PutFont(NULL); vDirLeft->Headers->PutFont(NULL);
See Also SftDirectory Object | Object Hierarchy