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
A new file/folder is selected (and remains selected).
VB.NET | Private Sub object_SelectionFinal(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.SelectionFinal |
VB | Private Sub object_SelectionFinal() |
C#.NET | void object_SelectionFinal(object sender, EventArgumentType e); |
VC++ | void OnSelectionFinalobject(); |
C | HRESULT OnSelectionFinalobject(); |
object
The SelectionFinal event occurs when a new file/folder is selected (and remains selected).
The SelectionChange event indicates that a selection has changed, but is not necessarily the final choice made by the user. The SelectionFinal event occurs once the selection has been made permanent. The distinction is made for combo box style controls (see ControlStyle property), which allow a selection change to occur in the dropdown list portion, but later canceled using the ESCAPE key. The SelectionFinal event would occur to signal the actual (final) selection once the dropdown list is closed.
Applications should generally use the SelectionFinal event, instead of the SelectionChange event. The SelectionChange event can be used to update a status bar or help information as a user makes selections in a combo box before they become permanent.
The SelectionCount property contains the number of currently selected folders. The selected folders can be retrieved using the Selection property.
The MultiSelect property defines whether only one or multiple folders can be selected at a time. Combo box style controls (see ControlStyle property) support single selection only.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' call this to update the buttons UpdateLeftButtons() UpdateRightButtons() AxSftDirectoryRight.MakeColumnsOptimal() End Sub Private Sub AxSftDirectoryLeft_SelectionFinal(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftDirectoryLeft.SelectionFinal ' If the selection in the left tree changes, update right side detaillist UpdateLeftButtons() AxSftDirectoryRight.Clear() AxSftDirectoryRight.CancelMode() AxSftDirectoryRight.Refresh() If Not AxSftDirectoryLeft.CurrentFolder Is Nothing Then AxSftDirectoryRight.TopMostFolderIDL = AxSftDirectoryLeft.CurrentFolder.ItemIDList Else
Private Sub Form_Load() ' call this to update the buttons UpdateLeftButtons UpdateRightButtons SftDirectoryRight.MakeColumnsOptimal End Sub Private Sub SftDirectoryLeft_SelectionFinal() ' If the selection in the left tree changes, update right side detaillist UpdateLeftButtons SftDirectoryRight.Clear SftDirectoryRight.CancelMode SftDirectoryRight.Refresh If Not SftDirectoryLeft.CurrentFolder Is Nothing Then SftDirectoryRight.TopMostFolderIDL = SftDirectoryLeft.CurrentFolder.ItemIDList Else
f = axSftDirectoryRight.RootFolder; buttonNewFolder.Enabled = false; if (f != null) { if (f.Can("NewFolder")) buttonNewFolder.Enabled = true; } } private void axSftDirectoryLeft_SelectionFinal(object sender, System.EventArgs e) { // If the selection in the left tree changes, update right side detaillist UpdateLeftButtons(); axSftDirectoryRight.Clear(); axSftDirectoryRight.CancelMode(); axSftDirectoryRight.Refresh(); if (axSftDirectoryLeft.CurrentFolder != null) axSftDirectoryRight.TopMostFolderIDL = axSftDirectoryLeft.CurrentFolder.ItemIDList;
{ // F5 automatically reloads right side, but we also want left side updated if (*KeyCode == VK_F5) { ISftDirectoryPtr vDirLeft = m_DirLeft.GetControlUnknown(); vDirLeft->Reload(VARIANT_TRUE, VARIANT_TRUE); } } void CSimpleExplorerDlg::OnSelectionFinal_SftDirectoryLeft() { ISftDirectoryPtr vDirRight = m_DirRight.GetControlUnknown(); ISftDirectoryPtr vDirLeft = m_DirLeft.GetControlUnknown(); UpdateLeftButtons(); vDirRight->Clear(); vDirRight->CancelMode();
See Also SftDirectory Object | Object Hierarchy