Drag/Drop |
Post Reply |
Author | |
dhnaigles
Newbie Joined: 31 December 2005 Status: Offline Points: 2 |
Post Options
Thanks(0)
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? |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
dhnaigles
Newbie Joined: 31 December 2005 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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 |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
eSynaptic
Newbie Joined: 07 March 2006 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |