'Declaration Public ReadOnly Property Appearances As Infragistics.Win.AppearancesCollection
public Infragistics.Win.AppearancesCollection Appearances {get;}
Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports Infragistics.Win.UltraWinSchedule.MonthViewSingle Private Sub ApplyControlAppearance() ' Create a new Appearance object and set a few properties Dim appearance As Infragistics.Win.Appearance = New Infragistics.Win.Appearance("BlueGradient") appearance.BackColor = Color.White appearance.BackColor2 = Color.LightBlue appearance.BackGradientStyle = GradientStyle.ForwardDiagonal ' Add the new appearance to the control's Appearances collection ' in case we want to use it again later Me.ultraMonthViewSingle1.Appearances.Add(appearance) ' Set the control's Appearance property to the new appearance ' Note that we can use the appearance object's Key property to ' access it, which is especially useful when there are several ' members in the Appearances collection, because referring to ' it by its index can then become confusing. Me.ultraMonthViewSingle1.Appearance = Me.ultraMonthViewSingle1.Appearances("BlueGradient") ' Make the associated UltraCalendarLook object's DayAppearance and WeekAppearance ' transparent, so that the control's Appearance settings will be visually apparent. ' ' It helps to think of the control's various appearances as "layers". The foremost ' layer is the UltraCalendarLook object's DayAppearance "behind" that is the ' WeekAppearance, and behind that is the control's own Appearance. ' Me.ultraMonthViewSingle1.CalendarLook.DayAppearance.BackColorAlpha = Alpha.Transparent Me.ultraMonthViewSingle1.CalendarLook.WeekAppearance.BackColorAlpha = Alpha.Transparent ' We can also set the degree of transparency by using the Appearance ' object's AlphaLevel property in conjunction with a BackColorAlpha setting ' of Alpha.UseAlphaLevel. The AlphaLevel property corresponds to the color's ' luminosity (or opacity) a value of 255 results in no transparency at all, meaning ' that the color is fully opaque. Reducing the value results in reducing the opacity, ' or put another way, increasing the transparency. ' ' Set the DayOfWeekHeaderAppearance's Alpha level to 64, so that the DayOfWeek ' headers are mostly but not fully transparent. Me.ultraMonthViewSingle1.CalendarLook.DayOfWeekHeaderAppearance.AlphaLevel = 64 Me.ultraMonthViewSingle1.CalendarLook.DayOfWeekHeaderAppearance.BackColorAlpha = Alpha.UseAlphaLevel ' If the DayAppearance is set but the SelectedDayAppearance was not, the ' SelectedDayAppearance will use the DayAppearance settings. This is an ' example of the appearance resolution hierarchy in action when an appearance ' is explicitly set, it is used, and if it is not explicitly set, the next most relevant ' appearance is used if it is explicitly set, and so on. ' ' Right now, the DayAppearance's BackColorAlpha is set to Alpha.Transparent, ' and the SelectedDayAppearance's BackColorAlpha is not set at all, so the ' SelectedDayAppearance is going to pick up the DayAppearance's BackColorAlpha. ' We can prevent this by explicitly setting the SelectedDayAppearance's BackColorAlpha ' by doing this, we cause the appearance resolution hierarchy to stop at the first ' explicit setting. Me.ultraMonthViewSingle1.CalendarLook.SelectedDayAppearance.BackColorAlpha = Alpha.Opaque End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using Infragistics.Win.UltraWinSchedule.MonthViewSingle; using System.Diagnostics; private void ApplyControlAppearance() { // Create a new Appearance object and set a few properties Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance( "BlueGradient" ); appearance.BackColor = Color.White; appearance.BackColor2 = Color.LightBlue; appearance.BackGradientStyle = GradientStyle.ForwardDiagonal; // Add the new appearance to the control's Appearances collection // in case we want to use it again later this.ultraMonthViewSingle1.Appearances.Add( appearance ); // Set the control's Appearance property to the new appearance // Note that we can use the appearance object's Key property to // access it, which is especially useful when there are several // members in the Appearances collection, because referring to // it by its index can then become confusing. this.ultraMonthViewSingle1.Appearance = this.ultraMonthViewSingle1.Appearances[ "BlueGradient" ]; // Make the associated UltraCalendarLook object's DayAppearance and WeekAppearance // transparent, so that the control's Appearance settings will be visually apparent. // // It helps to think of the control's various appearances as "layers". The foremost // layer is the UltraCalendarLook object's DayAppearance; "behind" that is the // WeekAppearance, and behind that is the control's own Appearance. // this.ultraMonthViewSingle1.CalendarLook.DayAppearance.BackColorAlpha = Alpha.Transparent; this.ultraMonthViewSingle1.CalendarLook.WeekAppearance.BackColorAlpha = Alpha.Transparent; // We can also set the degree of transparency by using the Appearance // object's AlphaLevel property in conjunction with a BackColorAlpha setting // of Alpha.UseAlphaLevel. The AlphaLevel property corresponds to the color's // luminosity (or opacity); a value of 255 results in no transparency at all, meaning // that the color is fully opaque. Reducing the value results in reducing the opacity, // or put another way, increasing the transparency. // // Set the DayOfWeekHeaderAppearance's Alpha level to 64, so that the DayOfWeek // headers are mostly but not fully transparent. this.ultraMonthViewSingle1.CalendarLook.DayOfWeekHeaderAppearance.AlphaLevel = 64; this.ultraMonthViewSingle1.CalendarLook.DayOfWeekHeaderAppearance.BackColorAlpha = Alpha.UseAlphaLevel; // If the DayAppearance is set but the SelectedDayAppearance was not, the // SelectedDayAppearance will use the DayAppearance settings. This is an // example of the appearance resolution hierarchy in action; when an appearance // is explicitly set, it is used, and if it is not explicitly set, the next most relevant // appearance is used if it is explicitly set, and so on. // // Right now, the DayAppearance's BackColorAlpha is set to Alpha.Transparent, // and the SelectedDayAppearance's BackColorAlpha is not set at all, so the // SelectedDayAppearance is going to pick up the DayAppearance's BackColorAlpha. // We can prevent this by explicitly setting the SelectedDayAppearance's BackColorAlpha; // by doing this, we cause the appearance resolution hierarchy to stop at the first // explicit setting. this.ultraMonthViewSingle1.CalendarLook.SelectedDayAppearance.BackColorAlpha = Alpha.Opaque; }
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