![]() |
How can I turn OFF inline editing of events? |
Post Reply ![]() |
Author | |
Nexxes ![]() Newbie ![]() Joined: 13 November 2009 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Nexxes ![]() Newbie ![]() Joined: 13 November 2009 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
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 |