Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.Diagnostics
Private Sub ultraCalendarInfo1_BeforeNoteRemoved(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.CancelableNoteEventArgs) Handles ultraCalendarInfo1.BeforeNoteRemoved
'----------------------------------------------------------------------------------------------------
' 説明
' BeforeNoteRemoved
'
' メモはコンポーネントの Notes コレクションから削除される前に発生します
' キャンセルされる場合、Note が削除されずに、AfterNoteRemoved イベントも発生しません
'
'----------------------------------------------------------------------------------------------------
' 日の Notes コレクションのカウントは 1 の場合、その日に 1 つのみの
' メモがあるため、削除を無効にし、ユーザーに通知します
If (e.Note.Day.Notes.Count = 1) Then
' Note の削除を回避するには、Cancel プロパティを
' True に設定します
e.Cancel = True
' ユーザーに状態を出力します
Dim info As String = String.Empty
info += "The day must have at least one note." + vbCrLf
MessageBox.Show(info, "BeforeNoteRemoved", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End Sub