Print Page | Close Window

Change Header background for a single day

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=18474
Printed Date: 08 July 2024 at 12:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change Header background for a single day
Posted By: mri0202
Subject: Change Header background for a single day
Date Posted: 31 May 2011 at 4:01am
Hi,

is it possible to change the header backcolor for a single day, when in month-, week- or dayview?

I want to change the background color, when it's a holiday.

My example changes the background color of all shown days, not for a single day
What's wrong?

Example
            If lFeiertagKz = False Then
                lErgebnis = ftFeierTagEmitteln(Params.Date)
                Debug.Print Params.Date
                If lErgebnis <> 0 Then
                    Select Case eObjType
                        Case xtpCalendarBeforeDraw_DayViewDay
                            pTheme2007.DayView.Day.Header.BaseColor = vbRed
                        Case xtpCalendarBeforeDraw_MonthViewDay
                            pTheme2007.MonthView.Day.Header.BaseColor = vbRed
       
        '                    pTheme2007.MonthView.Day.BackgroundLightColor = 13095160
        '                    pTheme2007.MonthView.Day.BackgroundSelectedColor = vbRed
       
                        Case xtpCalendarBeforeDraw_WeekViewDay
                           pTheme2007.WeekView.Day.Header.BaseColor = vbRed
                    End Select
                   
                End If
             End If


Thanks in advance

Manfred



Replies:
Posted By: SuperMario
Date Posted: 06 July 2011 at 2:06pm
You need BeforeDrawThemeObject:

CalendarControl.BeforeDrawThemeObjectFlags = -1

Private Sub CalendarControl_BeforeDrawThemeObject(ByVal eObjType As XtremeCalendarControl.CalendarBeforeDrawThemeObject, ByVal DrawParams As Variant)
    
    Dim pTheme2007 As CalendarThemeOffice2007
    Set pTheme2007 = CalendarControl.Theme
   
    If eObjType = xtpCalendarBeforeDraw_MonthViewDay Then
        pTheme2007.MonthView.Day.BackgroundDarkColor = vbWhite
    End If

End Sub



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net