Version

YearDisplayStyle Property

Determines how the year is displayed in the day area
Syntax
'Declaration
 
Public Property YearDisplayStyle As YearDisplayStyleEnum
public YearDisplayStyleEnum YearDisplayStyle {get; set;}
Remarks

Note: The YearDisplayStyle property works in conjunction with the DayDisplayStyle property in the following manner:

  • When DayDisplayStyle = DayDisplayStyleEnum.Auto, the year is displayed in 4-digit format where space permits, and in 2-digit format otherwise.
  • When DayDisplayStyle = DayDisplayStyleEnum.Full, the year is always displayed in 4-digit format.
  • When DayDisplayStyle = DayDisplayStyleEnum.Medium, the year is always displayed in 2-digit format.
  • When DayDisplayStyle = DayDisplayStyleEnum.Short, the year is not displayed.

Example
Demonstrates how to use the control's various display styles to customize the way the control displays the names of days of the week, and whether the name of the month and/or the year number appear in the day area.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports Infragistics.Win.UltraWinSchedule.MonthViewSingle

    Private Sub SetupDisplayStyles()

        '	Make the ActiveDay today
        Me.UltraMonthViewSingle1.CalendarInfo.ActiveDay = Me.UltraMonthViewSingle1.CalendarInfo.GetDay(DateTime.Today, True)

        '	Make the current day the only visible day in the control
        '	Hide all days of the week except for the day of the week of the current day
        Dim dow As Infragistics.Win.UltraWinSchedule.DayOfWeek
        For Each dow In Me.UltraMonthViewSingle1.CalendarInfo.DaysOfWeek
            If dow.DayOfTheWeek = Me.UltraMonthViewSingle1.CalendarInfo.ActiveDay.DayOfWeek.DayOfTheWeek Then
                dow.Visible = True
            Else
                dow.Visible = False
            End If
        Next

        '	Set the VisibleWeeks property to 1
        Me.UltraMonthViewSingle1.VisibleWeeks = 1

        '	Scroll the current day into view
        Me.UltraMonthViewSingle1.ScrollDayIntoView(DateTime.Today, True)

        '	Set the DayDisplayStyle property to Full
        Me.UltraMonthViewSingle1.DayDisplayStyle = DayDisplayStyleEnum.Full

        '	Set the DayOfWeekHeaderDisplayStyle property to Medium
        Me.UltraMonthViewSingle1.DayOfWeekHeaderDisplayStyle = DayDisplayStyleEnum.Medium

        '	Add an Appointment for today
        Me.UltraMonthViewSingle1.CalendarInfo.Appointments.Add(DateTime.Today.AddHours(9.0F), DateTime.Today.AddHours(9.5F), "Today's Appointment")

        '	Set the TimeDisplayStyle property to UseSystemSetting
        Me.UltraMonthViewSingle1.TimeDisplayStyle = TimeDisplayStyleEnum.UseSystemSetting

        '	Set the ActivityDisplayStyle property to Appointments
        Me.UltraMonthViewSingle1.ActivityDisplayStyle = ActivityDisplayStyleEnum.Appointments

        '	Set the YearDisplayStyle property to FirstDayOfMonth
        Me.UltraMonthViewSingle1.YearDisplayStyle = YearDisplayStyleEnum.FirstDayOfMonth

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

		private void SetupDisplayStyles()
		{

			//	Make the ActiveDay today
			this.ultraMonthViewSingle1.CalendarInfo.ActiveDay = this.ultraMonthViewSingle1.CalendarInfo.GetDay( DateTime.Today, true );

			//	Make the current day the only visible day in the control
			//	Hide all days of the week except for the day of the week of the current day
			foreach( Infragistics.Win.UltraWinSchedule.DayOfWeek dow in this.ultraMonthViewSingle1.CalendarInfo.DaysOfWeek )
			{
				if ( (int)( dow.DayOfTheWeek ) == (int)( this.ultraMonthViewSingle1.CalendarInfo.ActiveDay.DayOfWeek.DayOfTheWeek ) )
					dow.Visible = true;
				else
					dow.Visible = false;
			}

			//	Set the VisibleWeeks property to 1
			this.ultraMonthViewSingle1.VisibleWeeks = 1;

			//	Scroll the current day into view
			this.ultraMonthViewSingle1.ScrollDayIntoView( DateTime.Today, true );

			//	Set the DayDisplayStyle property to Full
			this.ultraMonthViewSingle1.DayDisplayStyle = DayDisplayStyleEnum.Full;

			//	Set the DayOfWeekHeaderDisplayStyle property to Medium
			this.ultraMonthViewSingle1.DayOfWeekHeaderDisplayStyle = DayDisplayStyleEnum.Medium;

			//	Add an Appointment for today
			this.ultraMonthViewSingle1.CalendarInfo.Appointments.Add( DateTime.Today.AddHours(9.0F), DateTime.Today.AddHours(9.5F), "Today's Appointment" );

			//	Set the TimeDisplayStyle property to UseSystemSetting
			this.ultraMonthViewSingle1.TimeDisplayStyle = TimeDisplayStyleEnum.UseSystemSetting;

			//	Set the ActivityDisplayStyle property to Appointments
			this.ultraMonthViewSingle1.ActivityDisplayStyle = ActivityDisplayStyleEnum.Appointments;

			//	Set the YearDisplayStyle property to FirstDayOfMonth
			this.ultraMonthViewSingle1.YearDisplayStyle = YearDisplayStyleEnum.FirstDayOfMonth;

		}
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