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
'----------------------------------------------------------------------------------------------------
' 説明
' BeforeNoteAdded
'
' 新しいメモがコンポーネントの Notes コレクションに追加される前に発生します
' キャンセルされる場合、Note が追加されずに、AfterNoteAdded イベントも発生しません
'
'----------------------------------------------------------------------------------------------------
If (e.Note.Day.Notes.Count > 0) Then
' Note の追加を回避するには、Cancel プロパティを
' True に設定します
e.Cancel = True
' ユーザーに状態を出力します
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