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 requested selected file/folder.
Get
VB.NET | refFolderObj = object.get_Selection(ByVal SelectionIndex As Integer) As SftDirectoryFolder |
VB | Set refFolderObj = object.Selection(ByVal SelectionIndex As Integer) As SftDirectoryFolder |
C#.NET | SftDirectoryFolder refFolderObj = object.get_Selection(int SelectionIndex); |
VC++ | ISftDirectoryFolder* refFolderObj = object->Selection[int SelectionIndex]; ISftDirectoryFolder* refFolderObj = object->GetSelection(int SelectionIndex); |
C | HRESULT object->get_Selection(int SelectionIndex, ISftDirectoryFolder** refFolderObj); |
object
SelectionIndex
The zero-based index of the selection to be returned.
refFolderObj
Returns the requested selected file/folder.
The Selection property returns the requested selected file/folder.
The SelectionCount property contains the number of currently selected files/folders. The selected files/folders can be retrieved using the Selection property.
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.
AxSftDirectory2.get_FolderList(3).Selected = True AxSftDirectory2.get_FolderList(5).Selected = True End Sub ' This is another button event handler Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' 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)
SftDirectory2.FolderList(3).Selected = True SftDirectory2.FolderList(5).Selected = True End Sub ' This is another button event handler Private Sub Command2_Click() ' 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).")
axSftDirectory2.get_FolderList(5).Selected = true; } // 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);
m_vDir2->FolderList[5]->Selected = VARIANT_TRUE; } // 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)
See Also SftDirectory Object | Object Hierarchy