Skip to main content

TdxBarItemLink.UserCaption Property

Specifies an alternative (user-defined, for example) bar item display name.

Declaration

property UserCaption: string read; write;

Property Value

Type Description
string

An alternative bar item display name.

Remarks

The initial toolbar display name is the Caption property value. Users can change display names of toolbar commands in a customization form or a context menu.

The UserCaption property specifies such a display name for all toolbar items associated with the current bar item link.

Property Setter Behavior

The UserCaption property setter adds the udCaption flag to the UserDefine property value.

Code Example: Change UI Command Names in Office Search Box Results

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

Default Value

The UserCaption property’s default value is an empty string.

The default UserCaption property value indicates that associated bar items display the Caption property value as a display name.

See Also