Ok,
Here's a snippet of code:
UltraCalendarInfo1.MinDate = "01/01/2010" UltraCalendarInfo1.MaxDate = "12/01/2010" UltraCalendarInfo1.Appointments.Add("1/12/2010", "6/12/2010", "Active") UltraCalendarLook1.AppointmentAppearance.BackColor = Color.Blue UltraCalendarLook1.AppointmentAppearance.BackColorAlpha = Infragistics.Win.Alpha.Opaque UltraCalendarLook1.AppointmentAppearance.AlphaLevel = 255
For whatever reason even adding the alpha level and the opaque setting doesn't do anything to change the background color of an appointment. Can anyone lead me in the right direction with this?
Thanks
Marvin
Did any one found a solution to this problem?
Andrew
Thanks Brian for your fast reply.I know the example code i've posted is the right way ^^, but it doesn't work for me :(.I've a UltraCalenderInfo and a UltraCalanderLook connected to the UltraMonthViewMulti.I add appointments like i've posted before and they are in the calendar but without the backgroundcolor i've set.Only the day font, where the appointment is added, is bold and there is no chance for me to change the backcolor.I also tryed to delete the connection to the UltraCalanderLook but the result is the same.Any idees ???
Coolzero said:Is it possible to set the color of an appointment while creating it ?
Hi GigiDolar,nice code but i'm a little bit to stupid to change it for my UltraMonthViewMulti :(
I must visualize two different types of appointments:The first one should be green, user byed something.The second one should be red, user byed nothing.(see picture below)Is it possible to set the color of an appointment while creating it ?example:Dim ap As New Appointment(Date.Now, Date.Now)ap.Appearance.BackColor = Color.RedUltraCalendarInfo.Appointments.Add(ap)
Any help would be appreciated.
Hey there,
I don't quite know why this happens, but there is a way to go around it using DrawFilter. It is a bit complicated but with it you can pretty much change whatever you like. The WinSchedule Appointments have a lot of issues unfortunately.
Here is an example of a DrawFilter Class (i have written it for my TimeLineView control, but you can adapt it quite easily):
class diagDrawFilter : IUIElementDrawFilter
{
public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams)
if (drawParams.Element is Infragistics.Win.UltraWinSchedule.TimelineView.AppointmentUIElement)
return DrawPhase.BeforeDrawBackColor;
else
return DrawPhase.None;
}
public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams)
Infragistics.Win.UltraWinSchedule.Appointment appointment = drawParams.Element.GetContext(typeof(Infragistics.Win.UltraWinSchedule.Appointment)) as Infragistics.Win.UltraWinSchedule.Appointment;
drawParams.AppearanceData.BackColor = Color.Yellow;
drawParams.AppearanceData.BackColor2 = Color.WhiteSmoke;
drawParams.AppearanceData.BackGradientStyle = GradientStyle.BackwardDiagonal;
return true;
return false;
Then just link this class to your control: control.DrawFilter = new diagDrawFilter();
with drawParams you can pretty much do everything with the appointment's appearance. If you need to resize or add UIElements (such as buttons) within the appointment, I suggest you use CreationFilter.
Hope it helps