RAD Studio |  |

Displaying an Auto-created Form
See Also
Collapse All

If you choose to create a form at startup, and do not want it displayed until sometime later during program execution, the form's event handler uses the ShowModal method to display the form that is already loaded in memory:

Copy Code

    procedure TMainForm.Button1Click(Sender: TObject);
    begin
    ResultsForm.ShowModal;
    end;

Copy Code

    void __fastcall TMainMForm::FirstButtonClick(TObject *Sender)
    {
    ResultsForm->ShowModal();
    }

In this case, since the form is already in memory, there is no need to create another instance or destroy that instance.

See Also

TForm

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!