Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Selected Event
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Selected Event

 Post Reply Post Reply
Author
Message
cannones View Drop Down
Groupie
Groupie
Avatar

Joined: 14 April 2010
Location: Australia
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote cannones Quote  Post ReplyReply Direct Link To This Post Topic: Selected Event
    Posted: 14 April 2010 at 11:47am
Hi All,

How does one know if the area of the calendar which is selected is on an existing event or not. When a user right mouse clicks on an area of the calendar I want to be able to check if an event exists below or not before displaying valid options in a popup menu..

Regards,
Sam
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: 14 April 2010 at 1:13pm
Private Sub CalendarControl_ContextMenu(ByVal X As Single, ByVal Y As Single)

    Debug.Print "On context menu"
    Dim EventID As Integer
    
    Dim HitTest As CalendarHitTestInfo
    Set HitTest = CalendarControl.ActiveView.HitTest
   
    If Not HitTest.ViewEvent Is Nothing Then
        Set ContextEvent = HitTest.ViewEvent.Event
        'EventID = ContextEvent.Id
        Me.PopupMenu mnuContexEditEvent
        Set ContextEvent = Nothing
    ElseIf (HitTest.HitCode = xtpCalendarHitTestDayViewTimeScale) Then
        Me.PopupMenu mnuContextTimeScale
    Else
        Me.PopupMenu mnuContextNewEvent
    End If

End Sub
Back to Top
cannones View Drop Down
Groupie
Groupie
Avatar

Joined: 14 April 2010
Location: Australia
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote cannones Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2010 at 4:14am
Thanks for this .. It seems to work okay although I cant seem to retrieve the Id of the event. Not sure why when I can retrieve all the other event properties.

Also is there a way of being able to select an appointment but not be allowed to edit or drag it. All the operations are controlled by right mouse clicking on an event which I give the user the option to open the event and view all other attributes I store against it ...
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.