From Free Pascal wiki

Deutsch (de) English (en) español (es) français (fr) português (pt)


MultiDoc is a Lazarus component to replace the standard MDI interface.

This component permit to write pseudo-MDI application with Lazarus. It is not a real implementation of the MDI interface but it give to your application the capability to use many resizable sub-form.

There are two components:

  • TMultiDoc : the main form docking area.
  • TChildDoc : the child container with resizeable border and button.

I do them with a graphical software in mind but they are probably useful for a range of applications.

Screen Shot

Multidoc demo.png


Patrick Chevalley


Modified LGPL, see readme.txt


The component and a demonstration program can be found on the Lazarus-CCR sourceforge site.

Change Log

  • Version 0.2 2007/01/06 Fix the following:
    1. BorderWidth property not working
    2. Wrong button order
    3. Center the cursor to the title bar when moving the panel
    4. Gtk2 and FPC 2.1.1 compatibility
    5. Crash when closing a child using the close button
    6. Change licensing to modified LGPL
  • Version 0.1 2006/01/20 First beta release.

Dependencies / System Requirements

This component is exclusively derived from high level standard component (TPanel, TCustomSplitter, TSpeedButton). It must work on all the Lazarus platform without change.

Tested on Linux and Windows.


You are not limited to show the docking area in the full main form. You can place the TMultiDoc anywhere you want or use multiple one! A combination with a TNotebook may give something similar to a multi-desktop.


  • Compile and install multidocpackage.lpk
  • Open the example demo/demomultidoc.lpi

This example can be used as a skeleton for a new application.


At design time:

  • On the application main form place a TMultiDoc.
  • Create a child form with a main TPanel.
  • Put all the object you want for the child to the panel, write the event, etc...
  • Do not rely on some TForm event as this form is never show.

At run time:

  • Create a new child from TMultiDoc.NewChild
  • Create a child form with the new childdoc as owner.
  • Assign the main panel to the Dockedpanel property.

Convert a Delphi MDI application

Converting a MDI application is simplified by the availability of the same component for Delphi and Kylix.

Convert first your application to MultiDoc in Delphi,then convert to Lazarus. This require some work but among the advantage you avoid the ugly XP border around your child forms.

Replace the standard MDI function as below:

  MDIChildCount   -> MultiDoc1.ChildCount
  ActiveMdiChild  -> MultiDoc1.ActiveObject
                  or MultiDoc1.ActiveChild
  MDIChildren[i]  -> MultiDoc1.Childs[i].DockedObject
                  or MultiDoc1.Childs[i]

The Delphi component is include in the package. Unzip and install MultiDocD6.dpk or MultiDocK3.dpk.