Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectoryFolder.Path Property

Defines the file/folder's full path.

Syntax

Get

VB.NETString = object.Path As String
VBString = object.Path As String
C#.NETstring String = object.Path;
VC++_bstr_t String = object->Path;
_bstr_t String = object->GetPath();
CHRESULT object->get_Path(BSTR* String);

object

A SftDirectoryFolder object.

String

Defines the file/folder's full path.

Comments

The Path property defines the file/folder's full path.

The file/folder's name can be retrieved using the Name property.

Certain folders, such as "My Computer" and "My Network Places", etc., return an empty string as the Path property. These are "virtual" folders, which do not physically exist.

Examples

VB.NET

    AxSftDirectory1.get_ColumnEntry(0).HeaderText = "Folder"
    AxSftDirectory1.get_ColumnEntry(1).HeaderText = "Full Path"
    AxSftDirectory1.get_ColumnEntry(1).Contents = SftDirectoryContentsConstants.contentsSftDirectoryUser1
    AxSftDirectory1.Reload(False, False)
End Sub

Private Sub AxSftDirectory1_UserContents(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_UserContentsEvent) Handles AxSftDirectory1.UserContents
    If e.contents = SftDirectoryContentsConstants.contentsSftDirectoryUser1 Then
        e.userString = e.folder.Path
    End If
End Sub

VB6

    SftDirectory1.ColumnEntry(0).HeaderText = "Folder"
    SftDirectory1.ColumnEntry(1).HeaderText = "Full Path"
    SftDirectory1.ColumnEntry(1).Contents = contentsSftDirectoryUser1
    SftDirectory1.Reload False, False
End Sub

Private Sub SftDirectory1_UserContents(ByVal Folder As SftDirectoryLib30.ISftDirectoryFolder, ByVal Contents As SftDirectoryLib30.SftDirectoryContentsConstants, UserString As String)
    If Contents = contentsSftDirectoryUser1 Then
        UserString = Folder.Path
    End If
End Sub

C#

    axSftDirectory1.get_ColumnEntry(1).HeaderText = "Full Path";
    axSftDirectory1.get_ColumnEntry(1).Contents = SftDirectoryContentsConstants.contentsSftDirectoryUser1;
    axSftDirectory1.Reload(false, false);
}

private void axSftDirectory1_UserContents(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_UserContentsEvent e)
{
    if (e.contents == SftDirectoryContentsConstants.contentsSftDirectoryUser1) {
        e.userString = e.folder.Path;
    }
}

C++

    return TRUE;  // return TRUE  unless you set the focus to a control
}

void CUserContentsDlg::OnUserContentsSftDirectory1(LPDISPATCH Folder, long Contents, BSTR FAR* UserString)
{
    ISftDirectoryFolderPtr pFolder = Folder;

    if (Contents == contentsSftDirectoryUser1) {
        *UserString = SysAllocString(pFolder->Path);
    }
}

See Also SftDirectoryFolder Object | Object Hierarchy


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