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
Returns the number of selected files/folders.
Get
VB.NET | Count = object.SelectionCount As Integer |
VB | Count = object.SelectionCount As Integer |
C#.NET | int Count = object.SelectionCount; |
VC++ | int Count = object->SelectionCount; int Count = object->GetSelectionCount(); |
C | HRESULT object->get_SelectionCount(int* Count); |
object
Count
Returns the number of selected files/folders.
The SelectionCount property returns the number of selected files/folders.
The MultiSelect property defines whether only one or multiple files/folders can be selected at a time. Combo box style controls (see ControlStyle property) support single selection only.
All selections can be cleared using the ClearSelection property.
' Show the selected file/folder (in a single selection control) Dim F As SftDirectoryFolder 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
' Show the selected file/folder (in a single selection control) 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
// 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)."); } }
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]; CString strName((LPCWSTR)pFolder->Name); CString str; str.Format(_T("\"%s\" is selected (in the multiple selection control)."), strName); AfxMessageBox(str); } }
See Also SftDirectory Object | Object Hierarchy