Export (0) Print
Expand All
Expand Minimize

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 _
) 
[C++]
HRESULT __stdcall get_Filter(
   /* [out, retval] */ BSTR* retVal
);
HRESULT __stdcall put_Filter(
   /* [in] */ BSTR NewValue
);
[C#]
public string Filter {get; set;}
[JScript .NET]
public function get Filter() : String
public function set Filter(
   NewValue : String
)

Parameters

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

Remarks

See AddFile for more information.

Example

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)
            MsgBox(filter.Filter)
            filter.Filter = ".cpp;.cxx;.c"
            MsgBox(filter.Filter)
        Next
    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

Show:
© 2014 Microsoft