Version

Display the Background Image Behind the Days of WinWeekView

The following example demonstrates how to use the WinWeekView’s™ CalendarLook Object to display the UltraWeekView’s ImageBackground "behind" the days using the element’s rich alpha-blending capabilities. This can be used to, for example, display a corporate logo in the element without distracting the end user.

  1. Set the property of the WinWeekView’s Appearance .

In Visual Basic:

Me.UltraWeekView1.Appearance.ImageBackground = _
  Image.FromFile("Program Dependent Files\Sunset.jpg")

In C#:

this.ultraWeekView1.Appearance.ImageBackground =
  Image.FromFile(@"Program Dependent Files\Sunset.jpg");
  1. Set the of the CalendarLook DayAppearance to half transparency.

In Visual Basic:

Me.UltraWeekView1.CalendarLook.DayAppearance.AlphaLevel = 128

In C#:

this.ultraWeekView1.CalendarLook.DayAppearance.AlphaLevel = 128;
  1. Set the CalendarLook DayAppearance BackColorAlpha to use the previously set AlphaLevel.

In Visual Basic:

Me.UltraWeekView1.CalendarLook.DayAppearance.BackColorAlpha = _
  Infragistics.Win.Alpha.UseAlphaLevel

In C#:

this.ultraWeekView1.CalendarLook.DayAppearance.BackColorAlpha =
  Infragistics.Win.Alpha.UseAlphaLevel;
  1. Because the WinWeekView’s DayAppearance is layered above it’s WeekAppearance, set the WeekAppearance BackColorAlpha to be transparent so that the ImageBackground will be displayed.

In Visual Basic:

Me.UltraWeekView1.CalendarLook.WeekAppearance.BackColorAlpha = _
  Infragistics.Win.Alpha.Transparent

In C#:

this.ultraWeekView1.CalendarLook.WeekAppearance.BackColorAlpha =
  Infragistics.Win.Alpha.Transparent;