Print Page | Close Window

EnsureVisible a CalendarEvent

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=18809
Printed Date: 16 November 2024 at 4:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: EnsureVisible a CalendarEvent
Posted By: McKloony
Subject: EnsureVisible a CalendarEvent
Date Posted: 10 August 2011 at 7:01am
How can I EnsureVisible a CalendarEvent. If I add a new CalendarEvent, that is one or two weeks in the future, i want to see this immediately after adding.


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

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6



Replies:
Posted By: SuperMario
Date Posted: 15 September 2011 at 3:29pm
did you try Calendar.ActiveView.SelectViewEvent?


Posted By: McKloony
Date Posted: 16 September 2011 at 7:38am
Yes I tried, but presumably I have the wrong syntax.
I dont know how to get a CalendarViewEvent from an CalendarEvent?
 


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

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: McKloony
Date Posted: 17 September 2011 at 4:33am
Calendar.ActiveView.SelectViewEvent needs a CalendarViewEvent Object. I only have a CalendarEvent Object in my function.


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

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: Fabian
Date Posted: 17 September 2011 at 8:29am
Hi McKloony
 
That's my solution (TERID is the appointments data base ID stored as proprty in each event):
 
For j = 0 To CalendarControl1.ActiveView.DaysCount - 1
  For k = 0 To CalendarControl1.ActiveView.Days(j).ViewGroups.Count - 1
    For l = 0 To CalendarControl1.ActiveView.Days(j).ViewGroups(k).ViewEvents.Count - 1
      If CalendarControl1.ActiveView.Days(j).ViewGroups(k).ViewEvents(l).Event.CustomProperties.Property("TERID") = TERID Then
        Call CalendarControl1.DayView.EnsureVisible(CalendarControl1.ActiveView.Days(j).ViewGroups(k).ViewEvents(l))
        Call CalendarControl1.ActiveView.SelectViewEvent(CalendarControl1.ActiveView.Days(j).ViewGroups(k).ViewEvents(l), True)
        CalendarControl1.Populate
        Exit For
      End If
    Next l 
  Next k
Next j
 
Hope that helps
 
Fabian


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

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