This documentation is archived and is not being maintained.

Filter Property

Visual Studio .NET 2003

Sets or returns a list of the file extensions associated with a folder.

[Visual Basic .NET]
Public Property Filter() As String
[Visual Basic 6]
Property Get Filter() As String
Property Let Filter( _
   ByVal NewValue As String _
HRESULT __stdcall get_Filter(
   /* [out, retval] */ BSTR* retVal
HRESULT __stdcall put_Filter(
   /* [in] */ BSTR NewValue
public string Filter {get; set;}
[JScript .NET]
public function get Filter() : String
public function set Filter(
   NewValue : String


The new list of file extensions that you want associated with the folder.


See AddFile for more information.


The following sample code uses Filter in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim idx As Integer
        Dim filter As VCFilter
        Dim col As IVCCollection
        Dim prj As VCProject
        prj = DTE.Solution.Projects.Item(1).Object
        col = prj.Filters
        For idx = 1 To col.Count
            filter = col.Item(idx)
            filter.Filter = ".cpp;.cxx;.c"
    End Sub
End Module

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCFilter Object