Print Page | Close Window

SOLVED: Office 2010 sample Background Colors

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=18033
Printed Date: 08 July 2024 at 3:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: Office 2010 sample Background Colors
Posted By: McKloony
Subject: SOLVED: Office 2010 sample Background Colors
Date Posted: 11 March 2011 at 4:08am
Congratiolations for the great VB Office 2010 sample. But how can I set the individuell Background Colors like you can see in the picture below?







-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6



Replies:
Posted By: SuperMario
Date Posted: 11 March 2011 at 10:02am
Here is a small sample:
 
CalendarControl.BeforeDrawThemeObjectFlags = -1
 
Private Sub CalendarControl_BeforeDrawThemeObject(ByVal eObjType As XtremeCalendarControl.CalendarBeforeDrawThemeObject, ByVal Params As Variant)
    Dim pTheme2007 As CalendarThemeOffice2007
    Set pTheme2007 = CalendarControl.Theme
       
    If eObjType = xtpCalendarBeforeDraw_DayViewTimeScaleCaption Then
        CalendarControl.Theme.DayView.TimeScale.Caption.Font.Italic = (Second(Now) Mod 2) = 0
        CalendarControl.Theme.DayView.TimeScale.Caption.Color = RGB(10, 200, 100)
        CalendarControl.Theme.DayView.TimeScale.LineColor = RGB(10, 200, 100)
       
    ElseIf eObjType = xtpCalendarBeforeDraw_DayViewCell Then
        Dim pCell As CalendarThemeDayViewCellParams
        Set pCell = Params
       
        If pCell.Index Mod 3 = 0 Then
            If pCell.WorkCell Then
                pTheme2007.DayView.Day.Group.Cell.WorkCell.BackgroundColor = RGB(200, 255, 0)
            Else
                pTheme2007.DayView.Day.Group.Cell.NonWorkCell.BackgroundColor = RGB(255, 200, 0)
            End If
        End If
       
    ElseIf eObjType = xtpCalendarBeforeDraw_DayViewDay Then
        pTheme2007.DayView.Day.Header.BaseColor = 20000 + 100 * Weekday(Params.Date)
        pTheme2007.DayView.Day.Header.TodayBaseColor = RGB(0, 0, 0)
       
    End If
   
End Sub


Posted By: McKloony
Date Posted: 12 March 2011 at 4:27am
Tank you verry much, this was exactly waht I was looking for. LOL

-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6



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