Out of memory : Too many forms; Killing the OK buttonclick event

Quote
Johan Stander wrote:

> Hi

> I designed and included a lot of forms in my project. When I tried to compile
> and run the app, I get the message
> "Cannot continue process : Out of memory(1)".
>  .. stuff deleted ..

Are you auto - creating all your forms on startup of the project? Check the options page on the
Project Manager ( View Menu) - you should only auto-create your main form on startup, and create
the other forms when needed.
eg. procedure btnNewForm ( Sender as Tobject);
begin
   frmNewForm := TfrmNewForm.Create(Application);
   frmNewForm.ShowModal;
   frmNewForm.Free;
end;

Quote

> Another question :
> I have a button of kind bkOK. When the user clicks on this button, I want to
> validate the information entered on the form. If there is any illegal
> information, I want to "kill" this event, so that the user can go back to the
> form and re-enter the correct data in the desired field. How do you do this ?

> Willie
> email : marai...@telkom15.telkom.co.za

Off the top of my head, you could try setting the ModalResult of the button to default to mrNone,
and only set it to mrOK when the data is valid.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Peter Wilkinson         .sig              
Bluize Pty Ltd          .here                
blu...@ctel.com.au      .now