Thursday, January 26, 2006

Converting a MDI form to SDI

In the Form itself:
  1. Change FormStyle property to fsNormal;
  2. Change Visible property to False;
  3. Remove the line "Action := caFree;" from OnClose event;
  4. Change property Position to poDesktopCenter or something else (optional);
  5. Override CreateParams to add extra funcionality, like make it have a button on taskbar or make it become indepent from the main form (optional);

In the caller Forms:
  1. Change "Application.CreateForm(FormClass,FormName)" to FormName.Show;

In the Project Options, tab "Forms":
  1. Move the Form from "Available" list to "Auto-create" list (if needed);
That's it.

No comments: