Delphi Change main form while application is running

Is it possible to change the main form while the application is already running?

It is not possible to change the VCL main form whilst the program is running. This property is determined once and for all when the program starts.

One possible way to proceed for you is to arrange for the secondary form, the form that is not the main form, to have a button on the taskbar. Do that by making it unowned, or by using the WS_EX_APPWINDOW extended window style.

Update

Well, you can change Application.MainForm, but it requires you to destroy the current main form, and then create a new one.

Leave a Comment