method Events.Remove (Handle as Variant)
Removes a specific member from the Events collection, giving its handle or reference.

TypeDescription
Handle as Variant A long expression that indicates the handle of the event. The Handle identifies unique the event, and is is allocated by the control. The Handle property of the event specifies the event's handle. A double/float expression that specifies the event's identifier. The KnownProperty(exEventID) property specifies the event's identifier. The Handle is automatically generated by the control, and can not be changed, while the IDentifier can be set by the user.
The Remove method removes the specified event. The Handle property of the Event object indicates the handle of the event to be removed. The Handle is automatically generated to be unique for any event, and it can not be changed. In other words, the Handle indicates the key to specify an event. You can use the UserData property of the Event to associate any extra data with your event. If the Remove method is called during the AddEvent event, use the Ev.Handle to remove the event. The control fires the Remove event once an Event is being removed. You can use the Remove any extra data associated with the event. The user can create new events using the mouse, if the AllowCreateEvent is not zero, using the Events.Add method or loading a XML document using the LoadXML method. The RemoveSelection method removes or erases all selected events in the schedule view. The Clear method of the Events collection clears all events in the schedule component. The ClearAll method clear all objects in the control, including the events. Use the GroupID property of the Event object to move a ( remove/add ) an Event from a Group to another.

The following VB sample asks 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