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

Drag/Drop

 Post Reply Post Reply
Author
Message
dhnaigles View Drop Down
Newbie
Newbie


Joined: 31 December 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote dhnaigles Quote  Post ReplyReply Direct Link To This Post Topic: Drag/Drop
    Posted: 31 December 2005 at 5:14pm

Is it possible to enable drag/drop. I have a label that I want to drag onto the calendar and create an event based upon the caption of the label and the date & time where it is dropped?  any ideas?

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: 02 January 2006 at 9:44am
Hi,

It's not yet available as a standard feature, but you can try to implement it with some of standards methods of your language, or catch mouse button down/up (/move) events as a workaround.

To determine the mouse position over the calendar you can use HitTest() method.

--
WBR,
Serge
Back to Top
dhnaigles View Drop Down
Newbie
Newbie


Joined: 31 December 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote dhnaigles Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2006 at 2:57pm

Serge- 

How would I use the HitTest() method to retrieve the begin and/or end datetime?  Can you give me an example of VB code that would return those values so that I can add an event?  Thanks.

 

David

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 January 2006 at 6:07am
David,

Sorry, I've just realized these members are not included in the ActiveX interface. So, for the next version 2 new properties will be added to CalendarHitTestInfo:
 
DATE HitDateTime;      ' Date or Date and Time corresponding to the cursor position.  

Boolean TimePartValid; ' true for the DayViewCell and DayViewTimeScale areas,
                               ' false for Week and Month views and for DayViewAllDayEvent area.
 
--
WBR,
Serge
Back to Top
eSynaptic View Drop Down
Newbie
Newbie


Joined: 07 March 2006
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote eSynaptic Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2006 at 10:48pm
I created a work around it by dragging the label into the calendar then simulating a mouse click upon drop. Here is my code:

'declarations
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10

'simulate a double click to fire the calendar's dblclick event
Private Sub CalendarControl_DragDrop(Source As Control, x As Single, y As Single)

mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, x, y, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, x, y, 0, 0       

End Sub

'get the selected times
Private Sub CalendarControl_DblClick()
Dim BeginTime As Date
Dim EndTime As Date
Dim bAllDay As Boolean

CalendarControl.DayView.GetSelection BeginTime, EndTime, bAllDay

Debug.Print BeginTime
Debug.Print EndTime

End Sub
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.