Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectoryFolder.MakeCurrent Method

Makes the file/folder the currently selected file/folder.

Syntax

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

object

A SftDirectoryFolder object.

Comments

The MakeCurrent method makes the file/folder the currently selected file/folder.

The Folder.MakeVisible method can be used to make the file/folder visible using vertical scrolling if needed.

Examples

VB.NET

    ' left tree (if possible)
    On Error Resume Next
    F = AxSftDirectoryLeft.get_FolderUsingIDL(IDL, False)
    On Error GoTo 0
    ' this will locate the exact item if we just added it
    F = AxSftDirectoryLeft.get_FolderUsingIDL(IDL, True)
    If Not F Is Nothing Then
        ' The folder has been added on the left side
        F.MakeCurrent() ' make it the current item
        F.MakeVisible() ' make sure it's scrolled into view
        e.allow = False ' no need to open it
    End If
End Sub

Private Sub AxSftDirectoryRight_SelectionFinal(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftDirectoryRight.SelectionFinal
    UpdateRightButtons()

VB6

    ' left tree (if possible)
    On Error Resume Next
    Set F = SftDirectoryLeft.FolderUsingIDL(IDL, False)
    On Error GoTo 0
    ' this will locate the exact item if we just added it
    Set F = SftDirectoryLeft.FolderUsingIDL(IDL, True)
    If Not F Is Nothing Then
        ' The folder has been added on the left side
        F.MakeCurrent ' make it the current item
        F.MakeVisible ' make sure it's scrolled into view
        Allow = False ' no need to open it
    End If
End Sub

Private Sub SftDirectoryRight_SelectionFinal()
    UpdateRightButtons

C#

    IDL = e.folder.ItemIDList; // the folder we are looking for
    // this will add the complete hierarchy down to the folder in
    // left tree (if possible)
    f = axSftDirectoryLeft.get_FolderUsingIDL(IDL, false);
    // this will locate the exact item if we just added it
    f = axSftDirectoryLeft.get_FolderUsingIDL(IDL, true);
    if (f != null) {
        // The folder has been added on the left side
        f.MakeCurrent(); // make it the current item
        f.MakeVisible(); // make sure it's scrolled into view
        e.allow = false; // no need to open it
    }
}

private void axSftDirectoryRight_SelectionFinal(object sender, System.EventArgs e) {
    UpdateRightButtons();

C++

    ISftDirectoryPtr vDirLeft = m_DirLeft.GetControlUnknown();

    // Move up on level in left side tree control
    ISftDirectoryFolderPtr f;
    f = vDirLeft->CurrentFolder;
    if (f != NULL) {
        f = f->Parent;
        if (f != NULL) {
            f->MakeCurrent(); // make it the current item
            f->MakeVisible(); // make sure it's scrolled into view
        }
    }
}

void CSimpleExplorerDlg::OnPropButton()
{

See Also SftDirectoryFolder Object | Object Hierarchy


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