Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectory.RootFolder Property

Returns the root folder.

Syntax

Get

VB.NETrefFolderObj = object.RootFolder As SftDirectoryFolder
VBSet refFolderObj = object.RootFolder As SftDirectoryFolder
C#.NETSftDirectoryFolder refFolderObj = object.RootFolder;
VC++ISftDirectoryFolder* refFolderObj = object->RootFolder;
ISftDirectoryFolder* refFolderObj = object->GetRootFolder();
CHRESULT object->get_RootFolder(ISftDirectoryFolder** refFolderObj);

object

A SftDirectory object.

refFolderObj

Returns the root folder.

Comments

The RootFolder property returns the root folder.

The root folder is the topmost folder whose contents are displayed. Depending on the control style (see ControlStyle property), the root folder is part of the display and loaded as the first folder (styleSftDirectoryTreeView and styleSftDirectoryComboBoxTreeView) or is not displayed and describes the contents displayed (styleSftDirectoryDetailList and styleSftDirectoryComboBoxDetailList).

The RootFolder is determined by the TopMostFolder property, which defines the topmost folder loaded.

Examples

VB.NET

    ButtonProp.Enabled = False
    If AxSftDirectoryRight.SelectionCount > 0 And Not F Is Nothing Then
        If F.Can("properties") Then
            ButtonProp.Enabled = True
        End If
    End If
    ' Enable/disable New Folder button
    ButtonNewFolder.Enabled = False
    F = AxSftDirectoryRight.RootFolder
    If Not F Is Nothing Then
        If F.Can("NewFolder") Then
            ButtonNewFolder.Enabled = True
        End If
    End If
End Sub

VB6

    Set F = SftDirectoryRight.CurrentFolder
    PropButton.Enabled = False
    If SftDirectoryRight.SelectionCount > 0 And Not F Is Nothing Then
        If F.Can("properties") Then
            PropButton.Enabled = True
        End If
    End If
    ' Enable/disable New Folder button
    Set F = SftDirectoryRight.RootFolder
    NewButton.Enabled = False
    If Not F Is Nothing Then
        If F.Can("NewFolder") Then
            NewButton.Enabled = True
        End If
    End If
End Sub

C#

    f = axSftDirectoryRight.CurrentFolder;
    buttonProp.Enabled = false;
    if (axSftDirectoryRight.SelectionCount > 0 && f != null) {
        if (f.Can("properties"))
            buttonProp.Enabled = true;
    }

    // Enable/disable New Folder button
    f = axSftDirectoryRight.RootFolder;
    buttonNewFolder.Enabled = false;
    if (f != null) {
        if (f.Can("NewFolder"))
            buttonNewFolder.Enabled = true;
    }
}

C++

        if (f->Can(_T("properties"))) {
            fEnable = TRUE;
        }
    }
    GetDlgItem(IDC_PROP_BUTTON)->EnableWindow(fEnable);

    // Enable/disable New Folder button
    fEnable = FALSE;
    f = vDirRight->RootFolder;
    if (f != NULL) {
        if (f->Can(_T("NewFolder"))) {
            fEnable = TRUE;
        }
    }
    GetDlgItem(IDC_PROP_NEWFOLDER)->EnableWindow(fEnable);
}

See Also SftDirectory Object | Object Hierarchy


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