Version

GetDayLook Method

Returns a DayLook object for a specific date.
Syntax
'Declaration
 
Public Function GetDayLook( _
   ByVal date As Date, _
   ByVal createIfNull As Boolean _
) As DayLook
public DayLook GetDayLook( 
   DateTime date,
   bool createIfNull
)

Parameters

date
Date for the day requested.
createIfNull
Forces the creation of a Day object if one does not already exist for the requested date.

Return Value

A DayLook object that corresponds with the Date provided.
Remarks

DayLook objects are "lazily" created as they are requested. If the createIfNull is false and the DayLook object associated with the specified date does not yet exist, a null (Nothing in VB) will be returned.

Example
The following code calls the various GetxxxLook methods on UltraCalendarLook.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

	Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

		' Use the date associated with today when calling the following methods.
		Dim todaysDate As DateTime = DateTime.Today


		' Get the DayLook object associated with today.
		Dim dayLook As DayLook = Me.UltraCalendarLook1.GetDayLook(todaysDate, True)

		Debug.WriteLine("The DayLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + dayLook.Appearance.BackColor.ToString())


		' Get the MonthLook object associated with today.
		Dim monthLook As MonthLook = Me.UltraCalendarLook1.GetMonthLook(todaysDate)

		' NOTE: there are 2 additional overloads for the GetMonthLook method that could
		' be called as follows:
		'dim monthLook as MonthLook = Me.ultraCalendarLook1.GetMonthLook(YearMonthEnum.January, todaysDate.Year)
		'dim monthLook as MonthLook = Me.ultraCalendarLook1.GetMonthLook(todaysDate.Month, todaysDate.Year)

		Debug.WriteLine("The MonthLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + monthLook.Appearance.BackColor.ToString())


		' Get the WeekLook object associated with today.
		Dim weekLook As WeekLook = Me.UltraCalendarLook1.GetWeekLook(todaysDate, Me.UltraDayView1.CalendarInfo)

		' NOTE: there is an overload for the GetWeekLook method that could be called as
		' follows:
		'dim weekLook as WeekLook = Me.ultraCalendarLook1.GetWeekLook(Me.ultraDayView1.VisibleDays(0).Day.Week.WeekNumber, todaysDate.Year)

		Debug.WriteLine("The WeekLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + weekLook.Appearance.BackColor.ToString())


		' Get the YearLook object associated with today.
		Dim yearLook As YearLook = Me.UltraCalendarLook1.GetYearLook(todaysDate.Year)

		Debug.WriteLine("The YearLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + yearLook.Appearance.BackColor.ToString())

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void button7_Click(object sender, System.EventArgs e)
		{

			// Use todays date when calling the following methods.
			DateTime todaysDate	= DateTime.Today;


			// Get the DayLook object associated with today.
			DayLook dayLook = this.ultraCalendarLook1.GetDayLook(todaysDate, true);

			Debug.WriteLine("The DayLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + dayLook.Appearance.BackColor.ToString());


			// Get the MonthLook object associated with today.
			MonthLook monthLook = this.ultraCalendarLook1.GetMonthLook(todaysDate);

			// NOTE: there are 2 additional overloads for the GetMonthLook method that could
			// be called as follows:
			//MonthLook monthLook = this.ultraCalendarLook1.GetMonthLook(YearMonthEnum.January, todaysDate.Year);
			//MonthLook monthLook = this.ultraCalendarLook1.GetMonthLook(todaysDate.Month, todaysDate.Year);

			Debug.WriteLine("The MonthLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + monthLook.Appearance.BackColor.ToString());


			// Get the WeekLook object associated with today.
			WeekLook weekLook = this.ultraCalendarLook1.GetWeekLook(todaysDate, this.ultraDayView1.CalendarInfo);

			// NOTE: there is an overload for the GetWeekLook method that could be called as
			// follows:
			//WeekLook weekLook = this.ultraCalendarLook1.GetWeekLook(this.ultraDayView1.VisibleDays[0].Day.Week.WeekNumber, todaysDate.Year);

			Debug.WriteLine("The WeekLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + weekLook.Appearance.BackColor.ToString());


			// Get the YearLook object associated with today.
			YearLook yearLook = this.ultraCalendarLook1.GetYearLook(todaysDate.Year);

			Debug.WriteLine("The YearLook backcolor for today (" + todaysDate.ToShortDateString() + ") is: " + yearLook.Appearance.BackColor.ToString());

		}
Requirements

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

See Also