Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - How can I turn OFF inline editing of events?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How can I turn OFF inline editing of events?

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


Joined: 13 November 2009
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nexxes Quote  Post ReplyReply Direct Link To This Post Topic: How can I turn OFF inline editing of events?
    Posted: 20 November 2009 at 5:19pm
On the calendar_dblclick event I an opening a form to edit data of the event.
 
I am not opening the form modal so that that can have more than 1 event
open for editing at time.
 
But the in-line editing causes some event to fire that returns focus back to
the calendar taking focus off the newly opened form.
 
This is very aqnnoying as when I open a form off the doubleclick event
I want the focus to stay on the newly opened form.
 
So is there a way to turn off the inline editing of events?
 
 
Thanks
Nate
 
Private Sub nakcalendar_DblClick()
'nakCalendar.ReadOnlyMode = True
    Dim HitTest As CalendarHitTestInfo
    Set HitTest = nakCalendar.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
        Dim newEventForm As Form
        Set newEventForm = New frmEvent_AddEdit
        newEventForm.NewEvent
        newEventForm.Show
    Else
        'only modify if not a call back
        If HitTest.ViewEvent.Event.CustomProperties.Property("SpecialCallBackEvent") = "no" Then
            ModifyEvent HitTest.ViewEvent.Event
        Else
            Set LastEventDblClicked = HitTest.ViewEvent.Event
            timerOPENContactWindow.Enabled = True
        End If
    End If
    'nakCalendar.ReadOnlyMode = False
End Sub
Back to Top
Nexxes View Drop Down
Newbie
Newbie


Joined: 13 November 2009
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nexxes Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2009 at 5:35pm
I have figured out a workaround
 
What I do now is have a timercontrol set to 1 second (disabled) that is triggered at the end of the dblclick
event of the calendar. The timer simply sets the calendarcontrol.ReadOnlyMode = false
 
And in the dblclick event of the calendar  i
nakCalendar.ReadOnlyMode = True
 
Then I can open my forms and the darn inline edit doesnt fire,
enable my timer to run 1 second after the dblclick event so that the code
runs to open my desired window
timerOPENContactWindow.Enabled = True
 
and now my form can open and the calendar inline edit never fires (returning
focus to it) and in 1 second the timer events fire to reenabled the calendar control.
 
Kindof a pain but it works
 
Private Sub nakcalendar_DblClick()
    Dim HitTest As CalendarHitTestInfo
    Set HitTest = nakCalendar.ActiveView.HitTest
   
    nakCalendar.ReadOnlyMode = True
'    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
        Dim newEventForm As Form
        Set newEventForm = New frmEvent_AddEdit
        newEventForm.NewEvent
        newEventForm.Show
    Else
        'only modify if not a call back
        If HitTest.ViewEvent.Event.CustomProperties.Property("SpecialCallBackEvent") = "no" Then
            ModifyEvent HitTest.ViewEvent.Event
        Else
           
            Dim nForm As Form
            Dim sPos As Long
             
            Set nForm = New frmCONTACTS_Details
            nForm.Tag = HitTest.ViewEvent.Event.CustomProperties.Property("FIDOContactID")
           
            nForm.Show
            Set nForm = Nothing
            AddNewOpenedFORM
        End If
    End If
timerOPENContactWindow.Enabled = True
End Sub
 
Private Sub timerOPENContactWindow_Timer()
timerOPENContactWindow.Enabled = False
nakCalendar.ReadOnlyMode = False
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.078 seconds.