Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDock
Private Sub ultraDockManager1_BeforePaneButtonClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinDock.CancelablePaneButtonEventArgs) Handles ultraDockManager1.BeforePaneButtonClick
' The BeforePaneButtonClick event is invoked when the
' user clicks a pane caption button but before the
' associated action is invoked. The Button parameter
' of the event args indicates the button that was clicked.
' The associated action may be prevented by setting the
' Cancel parameter to false.
'
' You can prevent a pane button's action from being invoked
' by setting the cancel parameter to true.
'
If (e.Button = PaneButton.Close) Then
Dim dr As DialogResult = MessageBox.Show(Me, _
"Are you sure you want to close this pane?", _
Application.ProductName, _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If (dr = DialogResult.No) Then
e.Cancel = True
End If
End If
End Sub