The
%EZ_Loading event occurs just "before" the control is created, so you can't use any commands which expect the control to exist in this event.
EZ_DefCalendarExColors
will fail in
%EZ_Loading because the control does not exist yet.
The event
%EZ_Loaded (ends in
ed rather than
ing) occurs right after the control is created, but before it is visible, so you can make calls to commands
which expect the control to exist in this event.
EZ_DefCalendarExColors should work fine in the %EZ_Loaded event !
Any command which has parameters for the form name and control ID, must be called only after the control is created and exists.
%EZ_Loading serves the purpose of changing control creation parameters for a control before it is created and for calls to EZGUI commands which have to be called before a control is create (ie. EZ_Color, EZ_UseFont).
Internally in all control creation commands it works this way:
{Control Creation Command}- Generate %EZ_Loading event if flagged to do so by a previous EZ_AllowLoadingEvent command
- Modify any control creation parameters if changing in %EZ_Loading event using EZ_SetLoadStr or EZ_SetLoadVal commands
- Create Control
- Generate %EZ_Loaded event
By understand the sequence EZGUI uses when creating controls you will know what you can do in each of the events, %EZ_Loading and %EZ_Loaded
Forms work the same way, but also have a third event called:
%EZ_Startedwhich occurs after the form is created, all the controls are created and the form is now visible