Back to Devexpress

How to Show/Hide All Items within a Category

vcl-155069-expressbars-how-to-show-hide-all-items-within-a-category.md

latest1.1 KB
Original Source

How to Show/Hide All Items within a Category

  • Dec 28, 2020

With the help of this example you’ll learn how to hide/display all items of a category. Use the CategoryItemsVisible property of a bar manager. The code below also hides empty toolbars via the AutoHideEmptyBars property.

delphi
// ...
with dxBarManager do
begin
  // Hides empty toolbars
  AutoHideEmptyBars := True;
  // Shows/hides items within the default category
  if CategoryItemsVisible[0] = ivAlways then
    CategoryItemsVisible[0] := ivNever
  else
    CategoryItemsVisible[0] := ivAlways;
end;
cpp
// ...
  // Hides empty toolbars
  dxBarManager->AutoHideEmptyBars = true;
  // Shows/hides items within the default category
  if (dxBarManager->CategoryItemsVisible[0] == ivAlways)
      dxBarManager->CategoryItemsVisible[0] = ivNever;
  else
    dxBarManager->CategoryItemsVisible[0] = ivAlways;