Back to Devexpress

DockManager.ShowingDockGuides Event

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-20966b65.md

latest6.1 KB
Original Source

DockManager.ShowingDockGuides Event

Occurs when an end-user drags a DockPanel into another panel and allows you to hide specific dock hints and guides. 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.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Docking")]
public event ShowingDockGuidesEventHandler ShowingDockGuides
vb
<DXCategory("Docking")>
Public Event ShowingDockGuides As ShowingDockGuidesEventHandler

Event Data

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

Remarks

The figure below illustrates all dock hints that can be displayed when a user drags one dock panel into another. If a target panel is not docked into the middle, hints 6, 7, 8 and 9 are not shown.

The ShowingDockGuides event arguments allow you to identify which panel a user drags…

csharp
if (e.Panel == dockPanel1) {
    //. . .
}
vb
If e.Panel = dockPanel1 Then
    '. . .
End If

…and which panel the user hovers over.

csharp
if (e.TargetPanel == dockPanel2) {
    //. . .
}
vb
If e.TargetPanel = dockPanel2 Then
    '. . .
End If

The Configuration property exposes multiple public methods that allow you to hide individual dock hints and their parent guides.

Dock hint 1

csharp
e.Configuration.Disable(DockHint.Center);
vb
e.Configuration.Disable(DockHint.Center)

Dock hints 2, 3, 4 and 5

csharp
e.Configuration.Disable(DockHint.CenterLeft); //hint #2
e.Configuration.Disable(DockHint.CenterTop); //hint #3
e.Configuration.Disable(DockHint.CenterRight); //hint #4
e.Configuration.Disable(DockHint.CenterBottom); //hint #5
vb
e.Configuration.Disable(DockHint.CenterLeft) 'hint #2
e.Configuration.Disable(DockHint.CenterTop) 'hint #3
e.Configuration.Disable(DockHint.CenterRight) 'hint #4
e.Configuration.Disable(DockHint.CenterBottom) 'hint #5

Dock hints 6, 7, 8 and 9

These hints are shown only when a user drags a panel into a center-docked panel.

csharp
e.Configuration.Disable(DockHint.CenterSideLeft); //hint #6
e.Configuration.Disable(DockHint.CenterSideTop); //hint #7
e.Configuration.Disable(DockHint.CenterSideRight); //hint #8
e.Configuration.Disable(DockHint.CenterSideBottom); //hint #9
vb
e.Configuration.Disable(DockHint.CenterSideLeft) 'hint #6
e.Configuration.Disable(DockHint.CenterSideTop) 'hint #7
e.Configuration.Disable(DockHint.CenterSideRight) 'hint #8
e.Configuration.Disable(DockHint.CenterSideBottom) 'hint #9

Dock hints 10, 11, 12 and 13

csharp
e.Configuration.Disable(DockHint.SideLeft); //hint #10
e.Configuration.Disable(DockHint.SideTop); //hint #11
e.Configuration.Disable(DockHint.SideRight); //hint #12
e.Configuration.Disable(DockHint.SideBottom); //hint #13
vb
e.Configuration.Disable(DockHint.SideLeft) 'hint #10
e.Configuration.Disable(DockHint.SideTop) 'hint #11
e.Configuration.Disable(DockHint.SideRight) 'hint #12
e.Configuration.Disable(DockHint.SideBottom) 'hint #13

Outer side hints (hints 10 to 13)

csharp
e.Configuration.DisableSideGuides();
vb
e.Configuration.DisableSideGuides()

All side hints (hints 6 to 13)

csharp
e.Configuration.DisableSideHints();
vb
e.Configuration.DisableSideHints()

Central guide (includes hints 1 to 9)

csharp
//when a target panel is docked to a side
e.Configuration.Disable(DockGuide.Center);
//when a target panel is docked to the middle
e.Configuration.Disable(DockGuide.CenterDock);
vb
'when a target panel is docked to a side
e.Configuration.Disable(DockGuide.Center)
'when a target panel is docked to the middle
e.Configuration.Disable(DockGuide.CenterDock)

Snap guides

These guides appear when you drag a panel to the edge of a screen.

csharp
e.Configuration.Disable(DockGuide.SnapLeft);
e.Configuration.Disable(DockGuide.SnapTop);
e.Configuration.Disable(DockGuide.SnapRight);
e.Configuration.Disable(DockGuide.SnapBottom);
//or
e.Configuration.DisableSnapGuides();
vb
e.Configuration.Disable(DockGuide.SnapLeft)
e.Configuration.Disable(DockGuide.SnapTop)
e.Configuration.Disable(DockGuide.SnapRight)
e.Configuration.Disable(DockGuide.SnapBottom)
'or
e.Configuration.DisableSnapGuides()

See Also

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace