How to Change the main form of an application at runtime ?



How to Change the main form of an application at runtime ?..

Answer / Muinuddeen Baktaber

To change the main form of an application at runtime in Delphi, you can use the Application.MainFormOnTaskbar property. Here's an example:

```
var
NewMainForm: TForm2; // assuming TForm2 is your new main form class
...
NewMainForm := TForm2.Create(nil); // create the new main form object
Application.MainFormOnTaskbar := NewMainForm; // set it as the new main form

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

How to Get a handle on your files ?

1 Answers  


How to Change the default width/height of the editor?

0 Answers  


How to print a TStringGrid or a TDBGrid ?

1 Answers  


How to Use Form Wizard to Quickly Create a Delphi Form?

1 Answers  


How to keep seconds from being included in the display when using TDateTimePicker?

1 Answers  


How to Create a non-VCL console project?

1 Answers  


How to Set a form's maxwidth in code?

1 Answers  


How to Free an object stored in a list?

1 Answers  


What should I give to Windows API functions that want a hWnd?

1 Answers  


How does Delphi handle Windows callbacks?

1 Answers  


Do the ADO components come with the professional version of Delphi 6?

1 Answers  


What does the error 'Token not found'?

1 Answers  


Categories