Skip to main content

DockManager.ShowingDockGuides Event

Occurs when an end-user drags a DockPanel onto another panel and allows you to hide specific dock hints and guides.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v26.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Docking")]
public event ShowingDockGuidesEventHandler ShowingDockGuides

Event Data

The ShowingDockGuides event's data class is DevExpress.XtraBars.Docking.ShowingDockGuidesEventArgs.

Remarks

If the DocumentManager component is also present on the form, handle its BaseView.ShowingDockGuides event to control which dock hints should be visible when a user drags a panel over this component.

The figure below illustrates all dock hints that can be displayed when a user drags one dock panel into another. If the target panel (that is hovered over) is not docked to the center, hints 6 to 9 are not displayed.

panel

The following table matches dock hints to their enum values:

Dock hint

Enum value

1

DockHint.Center

2

DockHint.CenterLeft

3

DockHint.CenterTop

4

DockHint.CenterRight

5

DockHint.CenterBottom

6

DockHint.CenterSideLeft

7

DockHint.CenterSideTop

8

DockHint.CenterSideRight

9

DockHint.CenterSideBottom

10

DockHint.SideLeft

11

DockHint.SideTop

12

DockHint.SideRight

13

DockHint.SideBottom

1-9

(if the target panel is docked to the center)

DockGuide.CenterDock

1-5

(if the target panel is docked to the side)

DockGuide.Center

Snap guides

DockGuide.SnapLeft

DockGuide.SnapTop

DockGuide.SnapRight

DockGuide.SnapBottom

Key event parameters

e.Panel
The dragged panel.
e.TargetPanel
The panel that is hovered over.
e.Configuration.Disable(DockHint enum value)
Allows you to hide specific dock guides.
e.Configuration.DisableSideGuides()
Allows you to to disable outer side hints (hints 10 to 13).
e.Configuration.DisableSideHints()
Allows you to to disable all side hints (hints 6 to 13).
e.Configuration.DisableSnapGuides()
Allows you to to disable all snap guides (guides that appear when you drag a panel to the edge of a screen).

The following code snippet disables center dock guides for a specific panel regardless of where it is docked:

using DevExpress.XtraEditors;
using DevExpress.XtraBars.Docking;
using DevExpress.XtraBars.Docking2010.Customization;

private void DockManager_ShowingDockGuides(object sender, ShowingDockGuidesEventArgs e) {
    if (e.TargetPanel == propertiesPanel) {
        e.Configuration.Disable(DockGuide.CenterDock);
        e.Configuration.Disable(DockGuide.Center);
    }
}
See Also