Type | Description | |||
Start as Variant | A DATE expressions that specifies the starting point of the event. | |||
End as Variant | A DATE expressions that specifies the ending point of the event. |
Return | Description | |||
Event | An Event object being created. |
The AllowCreateEvent property indicates the combination of keys that user can use to create a new event at runtime. The CreateEventLabel property specifies the label to be shown when the user creates a new event. The CreateEventLabelAlign property indicates the alignment of the label while user creates new events. The Background(exScheduleCreateEventBackColor) and Background(exScheduleCreateEventForeColor) properties indicate the visual aspect of the label being shown to create new events.
The following VB sample combines the AddEvent, LayoutStartCreating(exScheduleCreateEvent) and LayoutEndCreating(exScheduleCreateEvent), to ask the user if he wants to keep the newly created event, and if not, removes it:
Dim iCreatingEvent As Long Private Sub Schedule1_AddEvent(ByVal Ev As EXSCHEDULELibCtl.IEvent) If Not (iCreatingEvent = 0) Then If Not MsgBox("Do you allow creating this new event?", vbQuestion Or vbYesNoCancel) = vbYes Then Schedule1.Events.Remove (Ev.Handle) End If End If End Sub Private Sub Schedule1_LayoutStartChanging(ByVal Operation As EXSCHEDULELibCtl.LayoutChangingEnum) If (Operation = exScheduleCreateEvent) Then iCreatingEvent = iCreatingEvent + 1 End If End Sub Private Sub Schedule1_LayoutEndChanging(ByVal Operation As EXSCHEDULELibCtl.LayoutChangingEnum) If (Operation = exScheduleCreateEvent) Then iCreatingEvent = iCreatingEvent - 1 End If End Sub