Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxBarListItem.Items Example

The following code snippet demonstrates how to populate the Items collection of a TdxBarListItem.

The AddRecentFiles procedure displayed below adds a file specified by the AFileName parameter to the list of recently used files in a TdxBarListItem. The AMaxNumberOfFiles parameter specifies the maximum number of file names to store.

procedure AddRecentFiles(AFileName: string; AMaxNumberOfFiles: Integer);
var
  i: Integer;
begin
  with dxBarListItem1 do
  begin
    BarManager.BeginUpdate;
    if Items.Count < AMaxNumberOfFiles then
      Items.Add('');
    for i := Items.Count - 1 downto 1 do
      Items[i] := Items[i-1];
    Items[0] := AFileName;
    BarManager.EndUpdate;
  end;
end;