Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDock
Private Sub ultraDockManager1_BeforeToggleDockState(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinDock.CancelablePaneEventArgs) Handles ultraDockManager1.BeforeToggleDockState
' The BeforeToggleDockState is invoked when the user
' double clicks on the caption or tab item for a pane
' but before the window has changed position from
' floating to docked (or vice versa).
' The Cancel parameter can be set to true to cancel
' the change.
' Assuming a structure of:
' DockArea1
' Child1
' Child2
' DockArea2
' Child3
' With the following code, the user could double click
' on the caption of DockArea1, DockArea2, or Child3
' to change they're state from floating to docked.
'
' Do not allow the members of a group to have their
' state toggled from docked to floating or floating
' to docked if the pane has siblings
'
If (Not e.Pane.Parent Is Nothing AndAlso e.Pane.Parent.Panes.Count > 1) Then
e.Cancel = True
End If
End Sub