Print Page | Close Window

Picking a date

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=16089
Printed Date: 04 July 2025 at 1:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Picking a date
Posted By: dexatron
Subject: Picking a date
Date Posted: 27 January 2010 at 8:59am
Hi, I have a quick question for you.

I want to use the calendar manually.  That is I need a few events that include:

Date change --> returns the date clicked on
Month change --> notifies that the month has changed
Event click --> returns the id of an event so that I can take action

The Date change is the most important to me, I've been trying to extract this using the dbl-click event, with hittest

but obviously this line of code doesn't work becuase there is no selection property.

 gDate = Format(CalendarControl.ActiveView.days(CalendarControl.ActiveView.Selection).Date, "YYYY-MM-DD")

any help greatly appreciated, Greg



Replies:
Posted By: mdoubson
Date Posted: 29 January 2010 at 7:15pm
Why don't use same way as in function which use HitTest.ViewEvent.Event (e.g. you can use HitTest.ViewEvent.Event.StartTime)
Private Sub CalendarControl_DblClick()
    Dim HitTest As CalendarHitTestInfo
    Set HitTest = CalendarControl.ActiveView.HitTest
   
    Dim Events As CalendarEvents
    If Not HitTest.HitCode = xtpCalendarHitTestUnknown Then
     '   Set Events = CalendarControl.DataProvider.RetrieveDayEvents(HitTest.ViewDay.Date)
    End If
   
    If HitTest.ViewEvent Is Nothing Then
        MsgBox HitTest.HitDateTime
        mnuNewEvent_Click
    Else
        ModifyEvent HitTest.ViewEvent.Event
    End If
End Sub


-------------
Mark Doubson, Ph.D.



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