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

TdxBarManager.OnDocking Event

In This Article

Occurs when an end-user changes a toolbar’s position.

#Declaration

Delphi
property OnDocking: TdxBarCanDockingEvent read; write;

#Remarks

Handle the OnDocking event to perform specific actions when an end-user changes a toolbar’s position. This event is fired by the DoDocking function. This function initializes the event’s CanDocking parameter. Refer to the description of the DoDocking function to learn about the event’s parameters and the conditions which result in the event firing.

The following code prevents a toolbar which represents a main menu from docking to any side of a form except for its top:

procedure TForm1.dxBarManager1Docking(Sender: TdxBar; Style: TdxBarDockingStyle; var CanDocking: Boolean);
begin
  if Sender = GetBarManagerByForm(Self).MainMenuBar then
    if Style <> dsTop then
      CanDocking := False;
end;
See Also