HsiaLin wrote:Is there a way to make a temp spawned non-modal Form delete itself in its own OnClose or Destroy events?

I am not sure what you mean by delete itself but in the OnClose event, I set Action = caFreee to release all memory allocated for the form then set the pointer to the (temp) form to NULL.

In my MDI applications I manage my own forms and do a lot of this using a FormsAgent in combination with my other components. All forms other than the m,ain form are removed from Auto-create forms in options.

What im doing is i have a ListView on Form1 and i need Form3 to Show()... but not modally, becausei need to be able to interact with Form1 while Form3 is shown. I need to be able to delete Form3when it closes because it has a lot of init`ing it needs to do when it creates from new.

HsiaLin wrote:What im doing is i have a ListView on Form1 and i need Form3 to Show()... but not modally, becausei need to be able to interact with Form1 while Form3 is shown. I need to be able to delete Form3when it closes because it has a lot of init`ing it needs to do when it creates from new.

For MDI applications,

The way I handle this scenario is (others may have a different approach);

In the form that creates the (Form3) I would declare a TForm* frmFrm3 in the header file public: section.

Where you want to create the form, menu item or button or other I do this;

At this point (Form3) you will have access to any public methods and properties of the forms creator, the form that created Form3 will also have access to all public methods and properties so that you can do your Init's or call any other code you wish.

So, from the creator you would do your inits by say calling frmFrm3->Init() after it has been created then Shown.

Because you have direct access to the creator form and visa versa, you will not need to have while(Form3->Visible) or Application->ProcessMessages()