Jud McCranie mentioned this to Gary Weinfurther:
JM> First method I enter the name of my subroutine in the OI
JM> ShowForm event field.
JM> Second method double click on the OI ShowForm field and it will
JM> create the shell of a subroutine TForm1.ShowForm, and you can
JM> enter the call to your subroutine there.
These do the same thing. The second method merely allows you to name the
event handler yourself instead of using the default name. You can also
rename the handler later by editing its name in the OI.
I tend to use the following convention for putting code in an event handler:
If the code is small and relates directly to UI control, I put it in the
event handler. If the code is larger or is more related to application,
business, or data logic, I put it in a separate routine and call it from the
event handler.
Of course, you can always assign the event handlers yourself in the
FormCreate event handler:
Button1.OnClick := Button1Click;
Edit1.OnChange := Edit1Change;
But why spend the time and effort to do this? It's much faster and easier to
manage from the Object Inspector.
...Gary
--- GoldED 2.41
---------------
* Origin: The Flying Circus BBS, Farmington Hills, MI. (1:2410/905)
|