バージョン

BeforeDisplayDayToolTip イベント (UltraMonthViewMulti)

日付ツールチップが表示される前に発生します。
シンタックス
'宣言
 
Public Event BeforeDisplayDayToolTip As BeforeDisplayDayToolTipEventHandler
public event BeforeDisplayDayToolTipEventHandler BeforeDisplayDayToolTip
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、DayToolTipEventArgs 型の引数を受け取りました。次の DayToolTipEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Cancel System.ComponentModel.CancelEventArgsから継承されます。 
Date ツールチップに関連付けられたDayオブジェクトのDateを返します。
Day ツールチップに関連付けられたDayオブジェクトを返します。
ToolTip ツールチップに表示されるメッセージを決定します。
解説

UltraMonthViewMultiBase.TipStyleNone に設定される場合、BeforeDisplayDayToolTip イベントは発生しません。

ツールチップが表示されないように System.ComponentModel.CancelEventArgs.Cancel プロパティを使用して、BeforeDisplayDayToolTip イベントはキャンセルできます。

DayToolTipEventArgs.ToolTip プロパティは、ユーザーに表示されるツールチップを返します。このプロパティは、異なるツールチップを提供するために変更できます。DayToolTipEventArgs.Day は、ツールチップが表示される Day オブジェクトを返します。

使用例
NOTE: This example requires that the control's TipStyle property be set to 'Custom', like so:
Me.ultraMonthViewMulti1.TipStyle = Infragistics.Win.UltraWinSchedule.TipStyleDay.Custom
Private Sub ultraMonthViewMulti1_BeforeDisplayDayToolTip(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.DayToolTipEventArgs) Handles ultraMonthViewMulti1.BeforeDisplayDayToolTip

       '	The BeforeDisplayDayToolTip 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 day for which the tooltip is being displayed is a weekend
       '	day, cancel the event and return, which will prevent tooltips
       '	from being displayed for weekend days
       If (e.Date.DayOfWeek = System.DayOfWeek.Saturday Or _
         e.Date.DayOfWeek = System.DayOfWeek.Sunday) Then
           e.Cancel = True
           Return
       End If

       '	Get the name of the day of the week
       Dim dayOfWeek As String = e.Day.DayOfWeek.LongDescriptionResolved

       '	Determine whether there is activity for the day if there isn't,
       '	we will set the ToolTip property of the event arguments to
       '	"No activity", and return.
       If (Not e.Day.HasActivity) Then
           e.ToolTip = dayOfWeek + ": No activity"
           Return
       Else
           '	The day has activity, determine what kind(s) and how many
           Dim tipText As String = String.Empty
           If (e.Day.Appointments.Count > 0) Then
               tipText += e.Day.Appointments.Count.ToString() + " Appointment(s)" + vbCrLf
           End If
           If (e.Day.Holidays.Count > 0) Then
               tipText += e.Day.Holidays.Count.ToString() + " Holiday(s)" + vbCrLf
           End If

           If (e.Day.Notes.Count > 0) Then
               tipText += e.Day.Notes.Count.ToString() + " Note(s)" + vbCrLf
           End If
           '	Set the ToolTip property to the custom string we built
           e.ToolTip = dayOfWeek + ":" + vbCrLf + tipText
       End If

   End Sub
NOTE: This example requires that the control's TipStyle property be set to 'Custom', like so:
this.ultraMonthViewMulti1.TipStyle = Infragistics.Win.UltraWinSchedule.TipStyleDay.Custom;
private void ultraMonthViewMulti1_BeforeDisplayDayToolTip(object sender, Infragistics.Win.UltraWinSchedule.DayToolTipEventArgs e)
{

	//	The BeforeDisplayDayToolTip 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 day for which the tooltip is being displayed is a weekend
	//	day, cancel the event and return, which will prevent tooltips
	//	from being displayed for weekend days
	if ( e.Date.DayOfWeek == System.DayOfWeek.Saturday ||
		 e.Date.DayOfWeek == System.DayOfWeek.Sunday )
	{
		e.Cancel = true;
		return;
	}

	//	Get the name of the day of the week
	string dayOfWeek = e.Day.DayOfWeek.LongDescriptionResolved;

	//	Determine whether there is activity for the day; if there isn't,
	//	we will set the ToolTip property of the event arguments to
	//	"No activity", and return.
	if ( ! e.Day.HasActivity )
	{
		e.ToolTip = dayOfWeek + ": No activity";
		return;
	}
	else
	{
		//	The day has activity, determine what kind(s) and how many
		string tipText = string.Empty;
		if ( e.Day.Appointments.Count > 0 )
			tipText += e.Day.Appointments.Count.ToString() + " Appointment(s)" + "\n";
		if ( e.Day.Holidays.Count > 0 )
			tipText += e.Day.Holidays.Count.ToString() + " Holiday(s)" + "\n";
		if ( e.Day.Notes.Count > 0 )
			tipText += e.Day.Notes.Count.ToString() + " Note(s)" + "\n";

		//	Set the ToolTip property to the custom string we built
		e.ToolTip = dayOfWeek + ":" + "\n" + tipText;
	}

}
参照