Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectoryFolder.Parent Property

Returns the file/folder's parent folder.

Syntax

Get

VB.NETParentFolder = object.Parent As SftDirectoryFolder
VBSet ParentFolder = object.Parent As SftDirectoryFolder
C#.NETSftDirectoryFolder ParentFolder = object.Parent;
VC++ISftDirectoryFolder* ParentFolder = object->Parent;
ISftDirectoryFolder* ParentFolder = object->GetParent();
CHRESULT object->get_Parent(ISftDirectoryFolder** ParentFolder);

object

A SftDirectoryFolder object.

ParentFolder

Returns the file/folder's parent folder.

Comments

The Parent property returns the file/folder's parent folder.

The FirstSubfolder property returns a folder's first subfolder.

The Next property returns a file/folder's next folder within the same parent folder.

The Previous property returns a file/folder's previous folder within the same parent folder.

Examples

VB.NET

End Sub

Private Sub UpdateLeftButtons()
    ' Update the buttons dependent on the left tree
    Dim F As SftDirectoryFolder
    ' Enable/disable Up button
    F = AxSftDirectoryLeft.CurrentFolder
    If Not F Is Nothing Then
        F = F.Parent
    End If
    ButtonUp.Enabled = Not F Is Nothing
End Sub

Private Sub UpdateRightButtons()
    ' Update the buttons dependent on the right side detaillist
    Dim F As SftDirectoryFolder

VB6

End Sub

Private Sub UpdateLeftButtons()
    ' Update the buttons dependent on the left tree
    Dim F As SftDirectoryFolder
    ' Enable/disable Up button
    Set F = SftDirectoryLeft.CurrentFolder
    If Not F Is Nothing Then
        Set F = F.Parent
    End If
    UpButton.Enabled = Not F Is Nothing
End Sub

Private Sub UpdateRightButtons()
    ' Update the buttons dependent on the right side detaillist
    Dim F As SftDirectoryFolder

C#

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

private void UpdateRightButtons()
{
    // Update the buttons dependent on the right side detaillist
    SftDirectoryFolder f;
    // Enable/disable properties button

C++

void CSimpleExplorerDlg::UpdateLeftButtons()
{
    // Update the buttons dependent on the left tree
    ISftDirectoryFolderPtr f;
    // Enable/disable Up button
    ISftDirectoryPtr vDirLeft = m_DirLeft.GetControlUnknown();
    f = vDirLeft->CurrentFolder;
    if (f != NULL) {
        f = f->Parent;
    }
    GetDlgItem(IDC_UP_BUTTON)->EnableWindow(f != NULL);
}

void CSimpleExplorerDlg::UpdateRightButtons()
{
    ISftDirectoryPtr vDirRight = m_DirRight.GetControlUnknown();

See Also SftDirectoryFolder Object | Object Hierarchy


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