MetabaseListView.OnAfterSearch

Syntax

OnAfterSearch(Sender: Object; Args: IMetabaseListViewAfterSearchEventArgs);

Parameters

Sender. The parameter that returns the component that generated the event.

Args. The parameter that enables the user to determine event parameters.

Description

The OnAfterSearch event occurs for the component if all objects that satisfy given conditions were searched in the search dialog box.

Comments

The search in the component dialog box is opened on pressing CTRL+F or on executing the IMetabaseListView.ShowFindDialog method. The Find All button is available in the search dialog box when the IMetabaseListView.EnableFindAll property is set to True. If the Find All button is clicked in the dialog box, the search for the component results in the OnAfterSearch event generation. Use the IMetabaseListViewAfterSearchEventArgs.FoundObjects property of the event argument to get descriptions of found objects.

Example

Executing the example requires a form, a button with the Button1 identifier on this form and the MetabaseListView component with the MetabaseListView1 identifier. Any repository folder is selected in the Root property of the MetabaseListView component.

Add links to the ExtCtrls, Metabase system assemblies.

// The OnAfterSearch event handler for the MetabaseListView1 component
Sub MetabaseListView1OnAfterSearch(Sender: Object; Args: IMetabaseListViewAfterSearchEventArgs);
Begin
    Debug.WriteLine(
"Number of found objects:");
    Debug.WriteLine(Args.FoundObjects.Count);
End Sub MetabaseListView1OnAfterSearch;
// The OnClick event handler for the Button1 component
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
    MetabaseListView1.EnableFindAll := 
True;
    MetabaseListView1.ShowFindDialog;
End Sub Button1OnClick;

After executing the example the console window displays the information about the number of found objects.

See also:

MetabaseListView