Print Page | Close Window

how to color events - CalendarEventLabel.color ???

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=14218
Printed Date: 06 October 2024 at 10:54am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to color events - CalendarEventLabel.color ???
Posted By: Jaymeister
Subject: how to color events - CalendarEventLabel.color ???
Date Posted: 05 May 2009 at 10:46am
I'm trying to color events - was hoping it to be as easy as...

  Dim TimeObject As CalendarEvent
  Set TimeObject = CalendarCtrl2Use.DataProvider.CreateEvent
  TimeObject.backcolor = rgb(255,200,200)

searched for and found "CalendarEventLabel" stuff
I see the CalendarEventLabel.color property
just cannot get it to work in my VB6 sub

Sub NewTimeObject(CalendarCtrl2Use As CalendarControl, ByVal UniqueID$, StartYYYYMMDD$, StopYYYYMMDD$, StartHHMM$, StopHHMM$, Title$, Color2Use&, Optional RefreshCalendar%)
  Dim TimeObject As CalendarEvent, Recurrence As CalendarRecurrencePattern
  Set TimeObject = CalendarCtrl2Use.DataProvider.CreateEvent

  TimeObject.ScheduleID = UniqueID$
  TimeObject.Subject = Title$
  TimeObject.StartTime = YYYYMMDD2Format$(StartYYYYMMDD$, "dd Mmm yyyy") + "   " + Left$(StartHHMM$, 2) + ":" + Right$(StartHHMM$, 2)
  TimeObject.EndTime = YYYYMMDD2Format$(StopYYYYMMDD$, "dd Mmm yyyy") + "   " + Left$(StopHHMM$, 2) + ":" + Right$(StopHHMM$, 2)
  'TimeObject.Label = Color2Use&
 
  Dim pLabel As CalendarEventLabel
  'Set pLabel = frmMain.CalendarControl.DataProvider.???  how do I tell color to apply to TimeObject ???
  pLabel.Color = RGB(255, 200, 200)
 
  CalendarCtrl2Use.DataProvider.AddEvent TimeObject
  If RefreshCalendar% Then CalendarCtrl2Use.Populate
 
  'TimeObject.Id UniqueID$
  'TimeObject.Categories.Add "Category A"
  'TimeObject.CreationTime
  'TimeObject.CustomIcons.Add "?"
  'TimeObject.CustomProperties
  'TimeObject.DataProvider
  'TimeObject.LastModificationTime
  'TimeObject.RecurrencePattern
  'TimeObject.RecurrenceState
  'TimeObject.ReminderMinutesBeforeStart
  'TimeObject.ReminderSoundFile
End Sub

Help



Replies:
Posted By: Jaymeister
Date Posted: 07 May 2009 at 7:29am
The above code is VB6 on XP using demo calendar control


Posted By: axdoverm
Date Posted: 11 August 2010 at 4:01am

I have the same problem. When i looking at your code it's almost the same like my code. Do you already have a solution for your problem? Because its driving me already crazy for a few days now :)



-------------
Product: Xtreme SuitePro (ActiveX) version 11.2.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0



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