Canceling a NavigationPane select/deselect event

Topics: Knowledge Base
Coordinator
Jul 31, 2006 at 4:43 PM
In beta 2 we added Deselecting as an event on the NavigationPane. If you attach to this event you can use NavigationPaneCancelEventArgs.Cancel parameter to stop the selected button from becoming current.

Example:

private void navigationPane1_Deselecting(object sender, Ascend.Windows.Forms.NavigationPaneCancelEventArgs e)
{
DialogResult result = MessageBox.Show(this, "Do you want to change tabs?", "Test", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No)
{
e.Cancel = true;

}

}