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

DockManager.Docking Event

Fires repeatedly while a dock panel is being dragged.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Docking")]
public event DockingEventHandler Docking

#Event Data

The Docking event's data class is DockingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether the operation performed on the processed panel should be cancelled. Inherited from DockPanelCancelEventArgs.
Dock Gets a value indicating how the dock panel would be docked to the targeted control.
DragPoint Gets the mouse pointer’s coordinates relative to the top left corner of the screen.
Index Gets the position of the dock panel within the owning collection.
Panel Gets the processed dock panel. Inherited from DockPanelEventArgs.
TargetForm Gets the form (or user control) the panel is being docked to.
TargetPanel Gets the target panel, which the processed panel is being docked to.
TargetTabbed Identifies whether the dock panel will be turned into a tab within a tab container if it’s dropped at its current position.

#Remarks

Handle the Docking event to perform actions while a dock panel is being docked. For instance, you can prevent the panel from being docked at a certain position.

End-users can dock panels to other panels that are owned by the dock manager or to the form (user control). The DockingEventArgs.TargetForm and DockingEventArgs.TargetPanel event parameters identify the target form and panel, respectively. The DockPanelEventArgs.Panel event parameter specifies the panel being docked.

To forbid the current dock operation, set the DockPanelCancelEventArgs.Cancel event parameter to true.

For more information on how the docking operations can be performed in code, see the Controlling Dock Operations document.

See Also