Docking Tab for WinForms | ComponentOne
C1.Win.Command Namespace / C1DockingManager Class / Dragged Event
Example

In This Topic
    Dragged Event
    In This Topic
    Occurs after C1DockingTab or C1DockingTabPage is dragged.
    Syntax
    'Declaration
     
    
    Public Event Dragged As EventHandler(Of DraggedEventArgs)
    public event EventHandler<DraggedEventArgs> Dragged
    Event Data

    The event handler receives an argument of type DraggedEventArgs containing data related to this event. The following DraggedEventArgs properties provide information specific to this event.

    PropertyDescription
    The command dock that the C1DockingTab or C1DockingTabPage were dragged to.  
    The docking tab that was dragged.  
    The command dock from which the C1DockingTab or C1DockingTabPage were dragged.  
    Example
    You can change size DragSizingMode value here, depending on your needs. Which will allow you to enable or disable automatic resizing whenever you need it. Or you can manually set the value for the dragged control.
    private void c1DockingManager1_Dragged(object sender, DraggedEventArgs e)
    {
        switch(e.DockingTab.Dock)
        {
             case DockStyle.Left:
             case DockStyle.Right:
                 c1DockingManager1.DragSizingMode = ResizingMode.Proportional;
                 break;
             case DockStyle.Top:
             case DockStyle.Bottom:
                 c1DockingManager1.DragSizingMode = ResizingMode.Default;
                 e.DockingTab.Height = 100;
                 break;
             default:
                 c1DockingManager1.DragSizingMode = ResizingMode.Default;
                 break;
        }
    }
    See Also