Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - ThemeOffice2007 and cell backgroundcolor
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ThemeOffice2007 and cell backgroundcolor

 Post Reply Post Reply
Author
Message
KlausConlé View Drop Down
Newbie
Newbie
Avatar

Joined: 04 October 2006
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote KlausConlé Quote  Post ReplyReply Direct Link To This Post Topic: ThemeOffice2007 and cell backgroundcolor
    Posted: 04 October 2006 at 6:12am
Hello, I would like to change the background colour of each cell individually.  With the event BeforeDrawDayViewCell with the help of the class CalendarDayViewCellParams is possible. 
Now would I like to work with ThemeOffice2007, the appropriate event is BeforeDrawThemeObject, how I come to the Claas CalendarDayViewCellParams around the background colour of the cell to change?
kc
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2006 at 8:39am
Hi,

It access Cell parameters using Theme2007 object.

There are some info on it in another topic (with the example): http://forum.codejock.com/forum_posts.asp?TID=5170

--
WBR,
Serge
Back to Top
KlausConlé View Drop Down
Newbie
Newbie
Avatar

Joined: 04 October 2006
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote KlausConlé Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2006 at 8:59am
Thanks for the fast answer. I can set so the background color for the cells Work/NonWork, but as I can change the color for a certain cell?  I believe, I do not understand it correctly.
kc
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2006 at 7:47am
Yes, you can.

Use flag
xtpCalendarBeforeDraw_DayViewCell
and set members:
CalendarControl.Theme.DayView.Day.Group.Cell.WorkCell.BackgroundColor
CalendarControl.Theme.DayView.Day.Group.Cell.NonWorkCell.BackgroundColor

Params member is:
CalendarThemeDayViewCellParams

--
WBR,
Serge
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2006 at 3:34pm
BTW, below is the example (in VB.NET):

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxCalendarControl1.SetTheme(New CalendarThemeOffice2007Class)
        AxCalendarControl1.DayView.ShowDays(Now, Now.AddDays(2))

        If Not AxCalendarControl1.BeforeDrawThemeObjectFlags Is Nothing Then
            AxCalendarControl1.BeforeDrawThemeObjectFlags.SetFlag(CalendarBeforeDrawThemeObject.xtpCalendarBeforeDraw_DayViewCell)
        End If

        AxCalendarControl1.Populate()
    End Sub

    Private Sub AxCalendarControl1_BeforeDrawThemeObject(ByVal sender As Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_BeforeDrawThemeObjectEvent) Handles AxCalendarControl1.BeforeDrawThemeObject
        Dim pTheme2007 As CalendarThemeOffice2007
        pTheme2007 = AxCalendarControl1.Theme
        Dim pParam As CalendarThemeDayViewCellParams

        If e.eObjType = CalendarBeforeDrawThemeObject.xtpCalendarBeforeDraw_DayViewCell Then
            pParam = e.drawParams
            If pParam.BeginTime > Now Then
                pTheme2007.DayView.Day.Group.Cell.WorkCell.BackgroundColor = RGB(50, 150, 150)
                pTheme2007.DayView.Day.Group.Cell.NonWorkCell.BackgroundColor = RGB(50, 150, 150)
            End If
        End If
    End Sub

    Private Function RGB(ByVal r As Long, ByVal g As Long, ByVal b As Long) As UInt32
        RGB = Convert.ToUInt32(r + g * 256 + b * 256 * 256)
    End Function


--
WBR,
Serge
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.203 seconds.