Version

OnBeforeDisplayMonthPopup Method (UltraMonthViewMulti)

Syntax
'Declaration
 
Protected Overrides Sub OnBeforeDisplayMonthPopup( _
   ByVal e As BeforeDisplayMonthPopupEventArgs _
) 
protected override void OnBeforeDisplayMonthPopup( 
   BeforeDisplayMonthPopupEventArgs e
)

Parameters

e
A BeforeDisplayMonthPopupEventArgs that provides data for the event.
Remarks

Raising an event invokes the event handler through a delegate.

The OnBeforeDisplayMonthPopup method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors: When overriding OnBeforeDisplayMonthPopup in a derived class, be sure to call the base class's OnBeforeDisplayMonthPopup method so that registered delegates receive the event.

Example
This example cancels the event when the month for which the popup is being displayed does not fall in the current year.

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.

Private Sub ultraMonthViewMulti1_BeforeDisplayMonthPopup(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.BeforeDisplayMonthPopupEventArgs) Handles ultraMonthViewMulti1.BeforeDisplayMonthPopup

    '	The BeforeDisplayMonthPopup event is a "cancelable" event,
    '	which means that the action to which it corresponds can be
    '	prevented from happening by canceling the event.
    '	
    '	Canceling an event is very simple - just set the 'Cancel'
    '	property of the event arguments to true. The action will then
    '	be prevented from happening, and the corresponding "After"
    '	event will not fire.

    '	If the month for which the popup is being displayed is
    '	not in the current year, we will cancel the event, effectively
    '	diallowing the displaying of the popup.
    If (e.Month.Year.YearNumber <> DateTime.Today.Year) Then
        e.Cancel = True
    End If

End Sub
private void ultraMonthViewMulti1_BeforeDisplayMonthPopup(object sender, Infragistics.Win.UltraWinSchedule.BeforeDisplayMonthPopupEventArgs e)
{

	//	The BeforeDisplayMonthPopup event is a "cancelable" event,
	//	which means that the action to which it corresponds can be
	//	prevented from happening by canceling the event.
	//	
	//	Canceling an event is very simple - just set the 'Cancel'
	//	property of the event arguments to true. The action will then
	//	be prevented from happening, and the corresponding "After"
	//	event will not fire.

	//	If the month for which the popup is being displayed is
	//	not in the current year, we will cancel the event, effectively
	//	diallowing the displaying of the popup.
	if ( e.Month.Year.YearNumber != DateTime.Today.Year )
		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