Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - SOLVED: Office 2010 sample Background Colors
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED: Office 2010 sample Background Colors

 Post Reply Post Reply
Author
Message
McKloony View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 January 2007
Location: Germany
Status: Offline
Points: 340
Post Options Post Options   Thanks (0) Thanks(0)   Quote McKloony Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED: Office 2010 sample Background Colors
    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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
McKloony View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 January 2007
Location: Germany
Status: Offline
Points: 340
Post Options Post Options   Thanks (0) Thanks(0)   Quote McKloony Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.