バージョン

BeforePaneButtonClick イベント

PaneButton に関連付けられたアクションが実行される前に発生します。
シンタックス
'宣言
 
Public Event BeforePaneButtonClick As CancelablePaneButtonEventHandler
public event CancelablePaneButtonEventHandler BeforePaneButtonClick
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、CancelablePaneButtonEventArgs 型の引数を受け取りました。次の CancelablePaneButtonEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Button イベントに関連付けられた PaneButton を返します。
Cancel System.ComponentModel.CancelEventArgsから継承されます。 
Pane イベントに関連付けられたペインを返します。
使用例
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
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDock;
using System.Diagnostics;

private void ultraDockManager1_BeforePaneButtonClick(object sender, Infragistics.Win.UltraWinDock.CancelablePaneButtonEventArgs e)
{

	// 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)
	{
		DialogResult dr = MessageBox.Show(this,
			"Are you sure you want to close this pane?", 
			Application.ProductName,
			MessageBoxButtons.YesNo,
			MessageBoxIcon.Question);

		if (dr == DialogResult.No)
			e.Cancel = true;
	}

}
参照