Installing DockPanel Suite On Windows

By Lex Li

This page shows you how to install DockPanel Suite to your project on Windows.

In this article:

Install DockPanel Suite via NuGet

The easiest way to get started building applications with DockPanel Suite is to install via NuGet in the latest version of Visual Studio 2015 (including the free Community edition).

  1. Install Visual Studio 2015 .
Be sure to specify that you include the Windows and Web Development.
  1. Install latest NuGet Package Manager .
This will install the latest NuGet tooling.
  1. Open/create an empty Windows Forms project.
  2. Install DockPanel Suite NuGet packages following NuGet conventions .

The latest packages can be found at,

Note

VS2005MultithreadingTheme is not recommended for general usage.*

Warning

Theme package version should match main library version whenever possible. Otherwise, there can be compatibility issues.

  1. Create the DockPanel control in code and insert to the main form
public MainForm()
{
    InitializeComponent();

    this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
    this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
    this.Controls.Add(this.dockPanel);
}
  1. Create other panels by creating a new Form or new UserControl in Visual Studio
public class NewForm : Form
{

}

Change the base type to WeifenLuo.WinFormsUI.Docking.DockContent

public class NewDockContent : WeifenLuo.WinFormsUI.Docking.DockContent
{

}
  1. Show the custom DockContent in DockPanel as a document
public void ShowDockContent()
{
    var dockContent = new NewDockContent();
    dockContent.Show(this.dockPanel, DockState.Document);
}

Install DockPanel Suite via Source Code

Note

This approach requires Visual Studio 2015 and above. Please switch to NuGet package approach if you use older VS releases.

DockPanel Suite source code can be directly used in your project.

  1. Download the source code from GitHub , or clone the repo directly.
  2. Open/create a empty Windows Forms project in a solution.
  3. Add WinFormsUI.csproj in WinFormsUI directory to your solution.
  4. (optional) Add other theme projects such as ThemeVS2003.csproj to your solution.
  5. Compile the solution and DockPanel Suite controls are automatically added to Toolbox panel.
  6. Open main form of the empty project, and drag the DockPanel control from Toolbox on to it.
This will let Visual Studio generate the necessary code.
  1. Create other panels by creating new Form or new UserControl in Visual Studio
public class NewForm : Form
{

}

Change the base type to WeifenLuo.WinFormsUI.Docking.DockContent

public class NewDockContent : WeifenLuo.WinFormsUI.Docking.DockContent
{

}
  1. Show the custom DockContent in DockPanel as a document
public void ShowDockContent()
{
    var dockContent = new NewDockContent();
    dockContent.Show(this.dockPanel, DockState.Document);
}

Compile DockPanel Suite from Source Code

  1. Download the source code from GitHub , or clone the repo directly.
  2. Install .NET Framework 4.0 (or above) if it is not yet installed.
  3. Install Visual Studio 2015 (like Community edition) or above.
  4. Run all.bat in the source code to start compilation.

If everything works, then the binaries are in the bin folder.