Skip to main content

TdxOfficeSearchBoxDropDownMenuItemAddedEvent Type

The procedural type for search result notifications events in TdxOfficeSearchBox editors.

Declaration

TdxOfficeSearchBoxDropDownMenuItemAddedEvent = procedure(Sender: TdxOfficeSearchBoxProperties; ASourceItem: TObject; ADropDownMenuItem: TdxBarItemLink) of object;

Parameters

Name Type Description
Sender TdxOfficeSearchBoxProperties

Provides access to settings of the TdxOfficeSearchBox editor that raised the search result notification event.

ASourceItem TObject

Provides access to the bar item link associated with the UI command added to a drop-down menu.

Tip

Cast the returned object to the TdxBarItemLink class to access all public API members of the target bar item link.

ADropDownMenuItem TdxBarItemLink

Provides access to the bar item link associated with the UI command added to a drop-down menu.

You can use this parameter to customize link appearance settings.

Remarks

A search result notification event in an Office Search Box editor allows you to execute custom code in response to individual search result addition operations. For example, you can customize search result appearance.

Event Occurrence

A search result notification event occurs every time a TdxOfficeSearchBox editor adds a search result to a drop-down menu.

Code Example: Customize Search Result Appearance

The following code example changes the visible caption of a search result whose name or path includes 'Conditional' (Conditional Formatting, for example):

uses
  System.StrUtils,  // Declares the ContainsText global function
  dxOfficeSearchBox;  // Declares the TdxOfficeSearchBox class
// ...

procedure MyForm.dxOfficeSearchBox1PropertiesDropDownMenuPopulate(Sender: TdxOfficeSearchBoxProperties;
  ASourceItem: TObject; ADropDownMenuItem: TdxBarItemLink);
begin
  if ContainsText(ADropDownMenuItem.Caption, 'Conditional') then
    ADropDownMenuItem.UserCaption := 'Conditional Formatting Rule Management'
end;

VCL Bars: A Custom Search Result Caption in an Office Search Box

Direct TdxOfficeSearchBoxDropDownMenuItemAddedEvent Type Reference

The TdxOfficeSearchBoxProperties.OnDropDownMenuItemAdded event references the TdxOfficeSearchBoxDropDownMenuItemAddedEvent procedural type.

See Also