'Declaration Public Event Filter As EventHandler(Of ListBoxFilterEventArgs)
'Usage Dim instance As ListBox Dim handler As EventHandler(Of ListBoxFilterEventArgs) AddHandler instance.Filter, handler
public event EventHandler<ListBoxFilterEventArgs> Filter
Event Data
The event handler receives an argument of type ListBoxFilterEventArgs containing data related to this event. The following ListBoxFilterEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Accepted | true if the item passes the filter; false otherwise. By default, true. The item to inspect. |
Item | The item to inspect. |
Remarks
The Filter event is executed locally, meaning that all items will be retrieved from the server in order to determine those that pass the filter.
Example
Private Sub ListBox_Filter( ByVal sender As Object, ByVal e As ListBoxFilterEventArgs ) Dim order As Order = CType( e.Item, Order ) If order Is Nothing Then e.Accepted = False Else e.Accepted = ( order.ShippedDate > order.RequiredDate ) End If End Sub
private void ListBox_Filter( object sender, ListBoxFilterEventArgs e ) { Order order = e.Item as Order; if( order == null ) { e.Accepted = false; } else { e.Accepted = ( order.ShippedDate > order.RequiredDate ); } }
Requirements
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also