private void OnCloneCalendarDayQueryInfo(object sender, DayQueryInfoEventArgs e) { if (_selectedDates.Select(x => x.Date).Contains(e.Date)) { e.Info.BackColor1 = Color.Blue; e.Info.TextColor = Color.White; e.Info.DateColor = Color.White; e.OwnerDraw = true; } else if (e.Date == _day.Date) { e.Info.BackColor1 = Color.Green; e.Info.TextColor = Color.White; e.Info.DateColor = Color.White; e.OwnerDraw = true; } else if (e.Date.DayOfWeek == _day.Date.DayOfWeek && checkEditHighlightWeekdays.Checked && (e.Date >= _flightDateStart && e.Date <= _flightDateEnd)) { e.Info.BoldedDate = true; e.OwnerDraw = true; } else if (!(e.Date >= _flightDateStart && e.Date <= _flightDateEnd)) { e.Info.TextColor = Color.Gray; e.Info.DateColor = Color.Gray; e.OwnerDraw = true; e.OwnerDraw = true; } }
private void OnCloneCalendarDayQueryInfo(object sender, DayQueryInfoEventArgs e) { if (_sourceNote.StartDay <= e.Date && _sourceNote.FinishDay >= e.Date) { e.Info.BackColor1 = Color.Green; e.Info.TextColor = Color.Black; e.Info.DateColor = Color.Black; e.OwnerDraw = true; } if (_selectedRanges.Count(x => x.StartDate <= e.Date && x.FinishDate >= e.Date) > 0) { e.Info.BackColor1 = Color.Blue; e.Info.TextColor = Color.White; e.Info.DateColor = Color.White; e.OwnerDraw = true; } else if (_selectedDate.HasValue && e.Date.Equals(_selectedDate.Value)) { e.Info.BackColor1 = Color.Orange; e.Info.TextColor = Color.White; e.Info.DateColor = Color.White; e.OwnerDraw = true; } else if (!(e.Date >= _flightDateStart && e.Date <= _flightDateEnd)) { e.Info.TextColor = Color.Gray; e.Info.DateColor = Color.Gray; e.OwnerDraw = true; e.OwnerDraw = true; } }
private void monthCalendarClone_DayQueryInfo(object sender, DayQueryInfoEventArgs e) { if (_selectedDates.Select(x => x.Date).Contains(e.Date)) { e.Info.BackColor1 = Color.Blue; e.Info.TextColor = Color.White; e.Info.DateColor = Color.White; e.OwnerDraw = true; } else if (e.Date == _originalInsert.Date) { e.Info.BackColor1 = Color.Green; e.Info.TextColor = Color.White; e.Info.DateColor = Color.White; e.OwnerDraw = true; } else if (_originalInsert.Date.HasValue && e.Date.DayOfWeek == _originalInsert.Date.Value.DayOfWeek && checkEditHighlightWeekdays.Checked && (e.Date >= _originalInsert.Parent.Parent.FlightDateStart && e.Date <= _originalInsert.Parent.Parent.FlightDateEnd)) { e.Info.BoldedDate = true; e.OwnerDraw = true; } else if (!_originalInsert.Parent.AvailableDays.Contains(e.Date) || !(e.Date >= _originalInsert.Parent.Parent.FlightDateStart && e.Date <= _originalInsert.Parent.Parent.FlightDateEnd)) { e.Info.TextColor = Color.Gray; e.Info.DateColor = Color.Gray; e.OwnerDraw = true; e.OwnerDraw = true; } }
private void monthCalendar1_DayQueryInfo_1(object sender, DayQueryInfoEventArgs e) { Pabo.Calendar.MonthCalendar month = (Pabo.Calendar.MonthCalendar)sender; //if( e.Date == current_date ) { current_date = e.Date; int day = month_schedule.FindIndex(IsDate); if (day >= 0) { if (month_schedule[day].session_image_index >= 0) { e.Info.ImageListIndex = month_schedule[day].session_image_index; } e.Info.Text = month_schedule[day].session_sales_name; } e.OwnerDraw = true; } }
private void monthCalendar1_DayQueryInfo(object sender, DayQueryInfoEventArgs e) { // Check date //if( e.Date.DayOfWeek == DayOfWeek.Thursday ) { // Add custom formatting e.Info.BackColor1 = Color.Yellow; e.Info.BackColor2 = Color.GhostWhite; current_date = e.Date; int index = month_schedule.FindIndex(IsDate); e.Info.ImageListIndex = 1; e.Info.GradientMode = mcGradientMode.Horizontal; current_date = e.Date; int day = month_schedule.FindIndex(IsDate); e.Info.ImageListIndex = month_schedule[day].session_image_index; // Set ownerdraw = true to add custom formatting e.OwnerDraw = true; } }