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

How...?

 Post Reply Post Reply
Author
Message
cmm2006 View Drop Down
Senior Member
Senior Member


Joined: 26 September 2006
Status: Offline
Points: 118
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmm2006 Quote  Post ReplyReply Direct Link To This Post Topic: How...?
    Posted: 16 December 2007 at 4:31pm
Hi,
if I set my work days from Monday to Friday, how can I be able to tell the user every time he tries to add an event in the calendar in one of those days? (same question if I decides to change the work days to different days)
 
Note: I checked the calendarcontrol sample (Advanced Options) and I find the option de disable the creation of event on Saturday and Sunday (chkDisableInPlaceCreateEvents), it works good but when you double click it will open the 'New Event' window, and my request consist in disabling the double click also.
thank you!!!
 
Back to Top
Rafael View Drop Down
Newbie
Newbie
Avatar

Joined: 26 November 2007
Location: United States
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rafael Quote  Post ReplyReply Direct Link To This Post Posted: 19 December 2007 at 2:05pm
In the sample the following code is found in IsEditOperationDisabled.  If just before you do the 'mnuNewEvent_Click' in the DblClick Event, you use this code, it will determine what day you clicked and you can react accordingly.
 
<code>
 
        If DisableInPlaceCreateEvents_ForSaSu Then
            Dim dtBegin As Date, dtEnd As Date, bAllDay As Boolean
            Dim nSelDays As Long, nSelWDay As Long
                                  
            If CalendarControl.ActiveView.GetSelection(dtBegin, dtEnd, bAllDay) = False Then
                Exit Sub
            End If
           
            nSelDays = Abs(DateDiff("d", dtEnd, dtBegin))
            If dtBegin < dtEnd Then
                nSelWDay = Weekday(dtBegin)
            Else
                nSelWDay = Weekday(dtEnd)
            End If
           
            If bAllDay And nSelDays > 0 Then
                nSelDays = nSelDays - 1
            End If
           
            If nSelWDay = 1 Or (nSelWDay + nSelDays) >= 7 Then
                DisableOperation = True
            End If
 End If
 
</code>
 
The Hit test will tell you where you clicked, but not which day.  You can test that by breaking down the selection.
Back to Top
Rafael View Drop Down
Newbie
Newbie
Avatar

Joined: 26 November 2007
Location: United States
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rafael Quote  Post ReplyReply Direct Link To This Post Posted: 19 December 2007 at 2:08pm
Instead of disable operation = true, just exit 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.172 seconds.