Back to Devexpress

How to Disable Moving, Docking and Customizing of Toolbars

vcl-155057-expressbars-how-to-disable-moving-docking-and-customizing-of-toolbars.md

latest1.0 KB
Original Source

How to Disable Moving, Docking and Customizing of Toolbars

  • Dec 28, 2020

In order to disable runtime changes to a toolbar, set its AllowCustomizing and AllowQuickCustomizing properties to False.

To disable toolbar docking to a dock control, use the toolbar’s NotDocking property. If NotDocking includes dsNone , the floating toolbar cannot be moved.

The following code disables moving, changing, and docking of a toolbar.

delphi
// ...
with dxBarManager.Bars[0] do
begin
  AllowCustomizing := False;
  AllowQuickCustomizing := False;
  NotDocking := [dsNone,dsLeft,dsTop,dsRight,dsBottom];
end;
cpp
// ...
TdxBar * Bar;
Bar = dxBarManager->Bars->Items[0];
Bar->AllowCustomizing = false;
Bar->AllowQuickCustomizing = false;
Bar->NotDocking = Bar->NotDocking << dsNone << dsLeft << dsTop << dsRight << dsBottom;