Version

Set the Appointment Dialog Box to the Current Active Day

You can force the appointment dialog to always open to the active day, by using the WinCalendarInfo’s™ ActiveDay property.

Note
Note

This code will not work if placed in the BeforeDisplayAppointmentDialog event, as the call to DisplayAppointmentDialog would make a call to the BeforeDisplayAppointmentDialog causing a loop. This code is for use with your own custom appointment dialog or if you are making the appointment dialog show on a button click.

In Visual Basic:

Private Sub btnShowAppointmentDialog_Click(ByVal sender As System.Object, _
  ByVal e As System.EventArgs) Handles btnShowAppointmentDialog.Click
	Me.UltraCalendarInfo1.DisplayAppointmentDialog( _
	  Me.UltraCalendarInfo1.ActiveDay.Date, _
	  Me.UltraCalendarInfo1.ActiveDay.Date, False)
End Sub

In C#:

private void btnShowAppointmentDialog_Click(object sender, EventArgs e)
{
	this.ultraCalendarInfo1.DisplayAppointmentDialog(
	  this.ultraCalendarInfo1.ActiveDay.Date,
	  this.ultraCalendarInfo1.ActiveDay.Date, false);
}