Version

BeforeApplicationMenuDropDown Event

Cancelable event that occurs before the application menu on the ribbon opens up.
Syntax
'Declaration
 
Public Event BeforeApplicationMenuDropDown As CancelEventHandler
public event CancelEventHandler BeforeApplicationMenuDropDown
Event Data

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

PropertyDescription
Cancel  
Example
The sample demonstrates how to handle the BeforeApplicationMenuDropDown event.

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.UltraWinToolbars

Private Sub UltraToolbarsManager1_BeforeApplicationMenuDropDown(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles UltraToolbarsManager1.BeforeApplicationMenuDropDown
	Dim message As String = "The Application Menu is about to drop down. Would you like to cancel the drop down?"

	Dim result As DialogResult = MessageBox.Show(message, "Application Menu Dropping Down", MessageBoxButtons.YesNo)

	' If the user chose to stop the application menu from dropping down, cancel the event.
	' NOTE: This will be ignored unless UltraToolbarsManager.Office2007UICompatibility is false.
	If result = Windows.Forms.DialogResult.Yes Then
		e.Cancel = True
	End If
End Sub
using System.Windows.Forms;
using Infragistics.Win.UltraWinToolbars;

private void ultraToolbarsManager1_BeforeApplicationMenuDropDown( object sender, CancelEventArgs e )
{
	string message = "The Application Menu is about to drop down. Would you like to cancel the drop down?";

	DialogResult result = MessageBox.Show( message, "Application Menu Dropping Down", MessageBoxButtons.YesNo );

	// If the user chose to stop the application menu from dropping down, cancel the event.
	// NOTE: This will be ignored unless UltraToolbarsManager.Office2007UICompatibility is false.
	if ( result == DialogResult.Yes )
		e.Cancel = true;
}
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