Skip to main content

Using Dock Controls in MDI Applications

  • 2 minutes to read

The approach described in the Creating a Visual Studio .NET like Interface is not appropriate for MDI applications. This is because MDI child windows will not be visible if a dock site fills the form’s entire client area. Thus, you need to use the dock sites’ auto size feature to use dock windows in your MDI applications. This topic shows a simple example of creating such an application.

Follow the steps below:

  • Select the main menu’s File | New | Other… item. Switch to the Projects tab and select the MDI Application item. Click the OK button to create a new MDI application.

  • Place a TdxDockSite control on the form. Set the control’s Align property to alLeft.

  • Set the dock site’s AutoSize property to True. This forces the dock site to stretch automatically when docking panels or containers on it.

  • Set the site’s Width property to 0. This will hide the dock site. Note, however, that panels and containers can still be docked to the site. This is because the docking area doesn’t depend on the site’s size. Instead, it is controlled by the site’s dock zones. Please refer to the Zones Overview and Dock Zones topics for additional information.

  • All preparation is now complete. You can add dock panels to the application. The panels and containers constructed can be docked to the form’s left edge (where the hidden dock site resides). You can add additional dock sites to the form’s edges to allow docking to other edges.

The image below shows an example of a running MDI application. A panel is docked to the dock site residing at the form’s left edge.

Note

the approach described in this topic is not restricted to MDI applications, of course. You can also use it when developing non-MDI applications. However, using a single dock site occupying the entire form’s area provides more flexibility for dock control arrangements. Please refer to the Layout Sites topic for additional information.

See Also