Version

NavigationPaneFlyoutDisplaying Event

Occurs before the navigation pane flyout is displayed.
Syntax
'Declaration
 
Public Event NavigationPaneFlyoutDisplaying As NavigationPaneFlyoutDisplayingEventHandler
public event NavigationPaneFlyoutDisplayingEventHandler NavigationPaneFlyoutDisplaying
Event Data

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

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
Height Gets/sets the height of the navigation pane flyout.
Left Gets/sets the x-coordinate of the location of the navigation pane flyout, expressed in screen coordinates.
PreferredLocation Gets/sets the location of the navigation pane flyout, expressed in screen coordinates.
PreferredSize Gets/sets the size of the navigation pane flyout.
Top Gets/sets the y-coordinate of the location of the navigation pane flyout, expressed in screen coordinates.
Width Gets/sets the width of the navigation pane flyout.
Remarks

The end developer can prevent the navigation pane flyout from being displayed by canceling the NavigationPaneFlyoutDisplayed event (i.e., setting the Cancel property of the event arguments to true).

Example
The following code sample demonstrates how to use the NavigationPaneFlyoutMaximumSize and NavigationPaneFlyoutMinimumSize properties in conjunction with the NavigationPaneFlyoutDisplaying event to prevent resizing of the navigation pane flyout:

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar


    '   Handles the Form's 'Load' event
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        '	Hook the NavigationPaneFlyoutDisplaying event
        AddHandler Me.ultraExplorerBar1.NavigationPaneFlyoutDisplaying, AddressOf Me.ultraExplorerBar1_NavigationPaneFlyoutDisplaying
    End Sub

    '	Handles the ExplorerBar's 'NavigationPaneFlyoutDisplaying' event.
    Private Sub ultraExplorerBar1_NavigationPaneFlyoutDisplaying(ByVal sender As Object, ByVal e As NavigationPaneFlyoutDisplayingEventArgs)
        Dim explorerBar As UltraExplorerBar = sender

        '	Set the NavigationPaneFlyoutMaximumSize and NavigationPaneFlyoutMinimumSize
        '	properties to the same value, to prevent it from being resized.
        Dim navigationCurrentGroupAreaUIElement As UIElement = explorerBar.NavigationCurrentGroupAreaUIElement
        Dim height As Integer = IIf(Not navigationCurrentGroupAreaUIElement Is Nothing, navigationCurrentGroupAreaUIElement.Rect.Height, 0)
        Dim width As Integer = 200
        Dim flyoutSize As Size = New Size(width, height)
        explorerBar.NavigationPaneFlyoutMaximumSize = flyoutSize
        explorerBar.NavigationPaneFlyoutMinimumSize = flyoutSize

        '	Set the PreferredSize property of the event arguments to that size as well.
        e.PreferredSize = flyoutSize
    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinExplorerBar;
using System.Diagnostics;


		//	Handles the Form's 'Load' event.
		private void Form1_Load(object sender, System.EventArgs e)
		{
			//	Hook the NavigationPaneFlyoutDisplaying event
			this.ultraExplorerBar1.NavigationPaneFlyoutDisplaying += new NavigationPaneFlyoutDisplayingEventHandler( this.ultraExplorerBar1_NavigationPaneFlyoutDisplaying );
		}

		//	Handles the ExplorerBar's 'NavigationPaneFlyoutDisplaying' event.
		private void ultraExplorerBar1_NavigationPaneFlyoutDisplaying( object sender, NavigationPaneFlyoutDisplayingEventArgs e )
		{
			UltraExplorerBar explorerBar = sender as UltraExplorerBar;

			//	Set the NavigationPaneFlyoutMaximumSize and NavigationPaneFlyoutMinimumSize
			//	properties to the same value, to prevent it from being resized.
			UIElement navigationCurrentGroupAreaUIElement = explorerBar.NavigationCurrentGroupAreaUIElement;
			int height = navigationCurrentGroupAreaUIElement != null ? navigationCurrentGroupAreaUIElement.Rect.Height : 0;
			int width = 200;
			Size flyoutSize = new Size( width, height );
			explorerBar.NavigationPaneFlyoutMaximumSize = flyoutSize;
			explorerBar.NavigationPaneFlyoutMinimumSize = flyoutSize;

			//	Set the PreferredSize property of the event arguments to that size as well.
			e.PreferredSize = flyoutSize;
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also