SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the file/folder's name (including extension, if any).
Get
VB.NET | String = object.Name As String |
VB | String = object.Name As String |
C#.NET | string String = object.Name; |
VC++ | _bstr_t String = object->Name; _bstr_t String = object->GetName(); |
C | HRESULT object->get_Name(BSTR* String); |
Put
VB.NET | object.Name = String As String |
VB | object.Name = String As String |
C#.NET | string object.Name = String; |
VC++ | _bstr_t object->Name = String; void object->PutName(_bstr_t String); |
C | HRESULT object->put_Name(BSTR String); |
object
A SftDirectoryFolder object.
String
Defines the file/folder's name.
The Name property defines the file/folder's name (including extension, if any).
When setting the Name property, the file/folder is renamed. Only a relative folder name can be used (not an absolute path name).
The FileName and FileExt properties can be use to retrieve just the file name or extension.
To retrieve the file/folder name as it is displayed to the user, also use GetText(contentsSftDirectoryName).
The file/folder's full path can be retrieved using the Path property.
F = AxSftDirectory1.get_Selection(0) If Not F Is Nothing Then MessageBox.Show("""" & F.Name & """ is selected (in the single selection control).") End If ' Show the selected files/folders (in a multiple selection control) Dim I As Integer For I = 0 To AxSftDirectory2.SelectionCount - 1 F = AxSftDirectory2.get_Selection(I) MessageBox.Show("""" & F.Name & """ is selected (in the multiple selection control).") Next End Sub
Dim F As SftDirectoryFolder Set F = SftDirectory1.Selection(0) If Not F Is Nothing Then MsgBox ("""" & F.Name & """ is selected (in the single selection control).") End If ' Show the selected files/folders (in a multiple selection control) Dim I As Integer For I = 0 To SftDirectory2.SelectionCount - 1 MsgBox ("""" & SftDirectory2.Selection(I).Name & """ is selected (in the multiple selection control).") Next End Sub
// This is another button event handler private void button2_Click(object sender, System.EventArgs e) { // Show the selected file/folder (in a single selection control) SftDirectoryFolder F; F = axSftDirectory1.get_Selection(0); if (F != null) { MessageBox.Show("\"" + F.Name + "\" is selected (in the single selection control)."); } // Show the selected files/folders (in a multiple selection control) int i; for (i = 0 ; i < axSftDirectory2.SelectionCount ; ++i) { F = axSftDirectory2.get_Selection(i); MessageBox.Show("\"" + F.Name + "\" is selected (in the multiple selection control)."); } }
// This is another button event handler void CSelectionsDlg::OnButton2() { // Show the selected file/folder (in a single selection control) ISftDirectoryFolderPtr pFolder; pFolder = m_vDir1->Selection[0]; if (pFolder != NULL) { CString str; CString strName((LPCWSTR)pFolder->Name); str.Format(_T("\"%s\" is selected (in the single selection control)."), strName); AfxMessageBox(str); } // Show the selected files/folders (in a multiple selection control) int i; for (i = 0 ; i < m_vDir2->SelectionCount ; ++ i) { pFolder = m_vDir2->Selection[i];
See Also SftDirectoryFolder Object | Object Hierarchy