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 file/folder is added.
VB.NET | Private Sub object_Filtering(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.Filtering |
VB | Private Sub object_Filtering(Folder As SftDirectoryFolder, RemoveFolder As Boolean) |
C#.NET | void object_Filtering(object sender, EventArgumentType e); |
VC++ | void OnFilteringobject(ISftDirectoryFolder** Folder, VARIANT_BOOL* RemoveFolder); |
C | HRESULT OnFilteringobject(ISftDirectoryFolder** Folder, VARIANT_BOOL* RemoveFolder); |
object
Folder
Describes the SftDirectoryFolder being added to the control's contents.
RemoveFolder
Set to True to remove the folder from the control's contents or False to accept the folder.
The Filtering event occurs when a file/folder is added.
An application can decide to remove the folder as it is being added to the control, to implement application-specific filtering based on folder attributes or contents.
The AutoInitialLoad property may need to be set to False so the control does not load its contents immediately. This may be necessary if filtering is desired. The Filtering event may not occur when the control is initially created, due to certain environment restrictions. For example, in Visual Basic, the Filtering event is not generated until the Form_Load event has occurred. The control however is created before the Form_Load event occurs, preventing the Filtering events from being handled by the application. This in effect prevents any filtering from taking place. The solution is to set AutoInitialLoad to False and use the control's Reload method in the Form_Load event. Setting AutoInitialLoad to False isn't absolutely necessary, but it may save processing time as the control contents are only loaded once, in response to the Reload method.
' To avoid duplicate loading, use AutoInitialLoad = False in ' property page AxSftDirectory1.ControlStyle = SftDirectoryStyleConstants.styleSftDirectoryComboBoxDetailList AxSftDirectory1.TopMostFolderSpecial = SftDirectorySpecialFolderConstants.specialSftDirectoryMyComputer AxSftDirectory1.Headers.Style = SftDirectoryHeadersStyleConstants.headersSftDirectoryButton AxSftDirectory1.get_Column(SftDirectoryContentsConstants.contentsSftDirectoryName).HeaderText = "Drives" End Sub Private Sub AxSftDirectory1_Filtering(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_FilteringEvent) Handles AxSftDirectory1.Filtering ' This filters out folders such as "Shared Documents", "Control Panel", which ' are part of "My Computer" If e.folder.Type >= SftDirectoryFolderTypeConstants.typeSftDirectory_Computer_Drive35 And _ e.folder.Type <= SftDirectoryFolderTypeConstants.typeSftDirectory_Computer_Other Then ' OK, add this to the control contents Else e.removeFolder = True ' don't add this to the control contents
' To avoid duplicate loading, use AutoInitialLoad = False in ' property page SftDirectory1.ControlStyle = styleSftDirectoryComboBoxDetailList SftDirectory1.TopMostFolderSpecial = specialSftDirectoryMyComputer SftDirectory1.Headers.Style = headersSftDirectoryButton SftDirectory1.Column(contentsSftDirectoryName).HeaderText = "Drives" End Sub Private Sub SftDirectory1_Filtering(Folder As SftDirectoryLib30.ISftDirectoryFolder, RemoveFolder As Boolean) ' This filters out folders such as "Shared Documents", "Control Panel", which ' are part of "My Computer" If Folder.Type >= typeSftDirectory_Computer_Drive35 And Folder.Type <= typeSftDirectory_Computer_Other Then ' OK, add this to the control contents Else RemoveFolder = True ' don't add this to the control contents End If
// To avoid duplicate loading, use AutoInitialLoad = False in // property page axSftDirectory1.ControlStyle = SftDirectoryStyleConstants.styleSftDirectoryComboBoxDetailList; axSftDirectory1.TopMostFolderSpecial = SftDirectorySpecialFolderConstants.specialSftDirectoryMyComputer; axSftDirectory1.Headers.Style = SftDirectoryHeadersStyleConstants.headersSftDirectoryButton; axSftDirectory1.get_Column(SftDirectoryContentsConstants.contentsSftDirectoryName).HeaderText = "Drives"; } private void axSftDirectory1_Filtering(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_FilteringEvent e) { // This filters out folders such as "Shared Documents", "Control Panel", which // are part of "My Computer" if (e.folder.Type >= SftDirectoryFolderTypeConstants.typeSftDirectory_Computer_Drive35 && e.folder.Type <= SftDirectoryFolderTypeConstants.typeSftDirectory_Computer_Other) ;// OK, add this to the control contents else
m_vDir1->ControlStyle = styleSftDirectoryComboBoxDetailList; m_vDir1->TopMostFolderSpecial = specialSftDirectoryMyComputer; m_vDir1->Headers->Style = headersSftDirectoryButton; m_vDir1->Column[contentsSftDirectoryName]->HeaderText = "Drives"; return TRUE; } void CFilteringDlg::OnFilteringSftDirectory1(LPDISPATCH FAR* Folder, BOOL FAR* RemoveFolder) { ISftDirectoryFolderPtr pFolder(*Folder); // This filters out folders such as "Shared Documents", "Control Panel", which // are part of "My Computer" if (pFolder->Type >= typeSftDirectory_Computer_Drive35 && pFolder->Type <= typeSftDirectory_Computer_Other) ; // OK, add this to the control contents
See Also SftDirectory Object | Object Hierarchy