Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectory.MakeColumnsOptimal Method

Resizes all columns to their optimal width.

Syntax

VB.NETobject.MakeColumnsOptimal()
VBobject.MakeColumnsOptimal
C#.NETvoid object.MakeColumnsOptimal();
VC++HRESULT object->MakeColumnsOptimal();
CHRESULT object->raw_MakeColumnsOptimal();

object

A SftDirectory object.

Comments

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.

Examples

VB.NET

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

VB6

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

C#

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);
}

C++

    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


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