'Declaration Public Delegate Sub CancelableNoteEventHandler( _ ByVal sender As Object, _ ByVal e As CancelableNoteEventArgs _ )
public delegate void CancelableNoteEventHandler( object sender, CancelableNoteEventArgs e )
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports System.Diagnostics Private Sub ultraCalendarInfo1_BeforeNoteAdded(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.CancelableNoteEventArgs) Handles ultraCalendarInfo1.BeforeNoteAdded '---------------------------------------------------------------------------------------------------- ' Description ' BeforeNoteAdded ' ' Fires before a new note is added to the component's Notes collection. ' If canceled, the Note is not added, and the AfteNoteAdded event does not fire. ' '---------------------------------------------------------------------------------------------------- If (e.Note.Day.Notes.Count > 0) Then ' To prevent the addition of the Note, set the Cancel ' property to true e.Cancel = True ' Let the end user know what happened Dim info As String = String.Empty info += "There is already a Note for " + e.Note.Day.Date.ToLongDateString() + vbCrLf info += "Please edit the existing note rather than create a new one." MessageBox.Show(info, "BeforeNoteAdded", MessageBoxButtons.OK) End If End Sub
using System.Diagnostics; using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; private void ultraCalendarInfo1_BeforeNoteAdded(object sender, Infragistics.Win.UltraWinSchedule.CancelableNoteEventArgs e) { //---------------------------------------------------------------------------------------------------- // Description // BeforeNoteAdded // // Fires before a new note is added to the component's Notes collection. // If canceled, the Note is not added, and the AfteNoteAdded event does not fire. // //---------------------------------------------------------------------------------------------------- if ( e.Note.Day.Notes.Count > 0 ) { // To prevent the addition of the Note, set the Cancel // property to true e.Cancel = true; // Let the end user know what happened string info = string.Empty; info += "There is already a Note for " + e.Note.Day.Date.ToLongDateString() + ".\n"; info += "Please edit the existing note rather than create a new one."; MessageBox.Show( info, "BeforeNoteAdded", MessageBoxButtons.OK ); } }
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