event AddEvent (Ev as Event)
Notifies your application once the a new event is added.

TypeDescription
Ev as Event The Ev object indicates the new appointment/event being added.
The control fires the AddEvent event once the user creates a new appointment, or the Events.Add method has been invoked. You can use the AddEvent event to change the event's label, pictures, and so on. You can use the UserData property to associate any extra data to your event/appointment. The AddEvent event is fired also during loading an XML document using the LoadXML method. The control fires the LayoutStartChanging(exScheduleCreateEvent)/LayoutEndChanging( exScheduleCreateEvent) event once the user creates a new event using the mouse. The Start and End properties of the Event are known at the moment the AddEvent event occurs. You can handle the AddEvent event to invoke your dialogs in other to update any other property of the newly added event. You can also, call the Remove event in case you need to remove the event. The ChangeEvent(exAddEvent) event is equivalent with the AddEvent event.

The AllowCreateEvent property specifies the keys combination to let user creates new events at runtime. The CreateEventLabel property indicates the label to be shown when the user creates a new event at runtime. You can use the Background(exScheduleCreateEventBackColor) and Background(exScheduleCreateEventForeColor)  properties to specify the visual appearance of the events being updated at runtime * moving or resizing ).

Syntax for AddEvent event, /NET version, on:

private void AddEvent(object sender,exontrol.EXSCHEDULELib.Event Ev)
{
}

Private Sub AddEvent(ByVal sender As System.Object,ByVal Ev As exontrol.EXSCHEDULELib.Event) Handles AddEvent
End Sub

Syntax for AddEvent event, /COM version, on:

private void AddEvent(object sender, AxEXSCHEDULELib._IScheduleEvents_AddEventEvent e)
{
}

void OnAddEvent(LPDISPATCH Ev)
{
}

void __fastcall AddEvent(TObject *Sender,Exschedulelib_tlb::IEvent *Ev)
{
}

procedure AddEvent(ASender: TObject; Ev : IEvent);
begin
end;

procedure AddEvent(sender: System.Object; e: AxEXSCHEDULELib._IScheduleEvents_AddEventEvent);
begin
end;

begin event AddEvent(oleobject Ev)
end event AddEvent

Private Sub AddEvent(ByVal sender As System.Object, ByVal e As AxEXSCHEDULELib._IScheduleEvents_AddEventEvent) Handles AddEvent
End Sub

Private Sub AddEvent(ByVal Ev As EXSCHEDULELibCtl.IEvent)
End Sub

Private Sub AddEvent(ByVal Ev As Object)
End Sub

LPARAMETERS Ev

PROCEDURE OnAddEvent(oSchedule,Ev)
RETURN

Syntax for AddEvent event, /COM version (others), on:

<SCRIPT EVENT="AddEvent(Ev)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function AddEvent(Ev)
End Function
</SCRIPT>

Procedure OnComAddEvent Variant llEv
	Forward Send OnComAddEvent llEv
End_Procedure

METHOD OCX_AddEvent(Ev) CLASS MainDialog
RETURN NIL

void onEvent_AddEvent(COM _Ev)
{
}

function AddEvent as v (Ev as OLE::Exontrol.Schedule.1::IEvent)
end function

function nativeObject_AddEvent(Ev)
return

The following VB sample shows how you can change the event's pattern once a new event is created:

Private Sub Schedule1_AddEvent(ByVal Ev As EXSCHEDULELibCtl.IEvent)
    With Ev.BodyPattern
        .Type = exPatternBDiagonal
        .Color = RGB(128, 128, 128)
    End With
End Sub

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