Skip to main content

DockManager.CreateResizeZone Event

Allows you to prevent dock panels from being resized using the mouse at specific borders and corners.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

[DXCategory("Docking")]
public event CreateResizeZoneEventHandler CreateResizeZone

Event Data

The CreateResizeZone event's data class is DevExpress.XtraBars.Docking.CreateResizeZoneEventArgs.

Remarks

When an end-user hovers over a border or corner of a dock panel with the mouse pointer, the pointer changes its view to a double-headed arrow indicating that the current panel can be resized. See the figure below.

DockManager_ResizeDirections

By default, a dock panel can be resized at all its borders and corners. Handle the CreateResizeZone event to customize at which borders and corners dock panels cannot be resized using the mouse.

The CreateResizeZoneEventArgs object, passed to the event handler as a parameter, exposes the Panel property which allows you to determine the dock panel being processed. The Direction property returns the ResizeDirection enumeration value that specifies the border or corner of the dock panel at which to prohibit the resizing feature.

The ResizeDirection enumeration is a set of flags and supports flag bitwise combinations. The Left, Right, Top and Bottom values specifies corresponding borders of the dock panel. Bitwise combinations of flags specifies corresponding corners of the dock panel. For instance, a bitwise combination of the Bottom and Right flags specifies the bottom right corner of the panel.

To prohibit resizing the dock panel at a particular border or corner, set the Cancel property to true. The sample event handler below shows how to prevent dock panels from being resized at the bottom right corner.

private void dockManager1_CreateResizeZone(object sender, DevExpress.XtraBars.Docking.CreateResizeZoneEventArgs e) {
    if (e.Direction == (ResizeDirection.Bottom | ResizeDirection.Right))
        e.Cancel = true;
}

The CreateResizeZone event allows you to manage the resizing feature in a centralized way. For the same purpose at the level of dock panels, you can also handle the panel’s DockPanel.CreateResizeZone event or use the DockPanelOptions.ResizeDirection property, accessible through the panel’s DockPanel.Options property.

See Also