views:

227

answers:

1

I want to make only two panels like solution explorer and toolbox (visual studio) in my application.

The problem is that i don't understand how it works in weifen library. Can you give me a step-by-step explaination how can I make two dockable panels, please ?

+1  A: 

Follow the following steps:

  • Add reference to the Docking library.
  • Create two forms.
  • For each form go to source view and extend them from the DockContent class.

    public partial class ToolWindow : DockContent
    {
         public ToolWindow()
        {
            InitializeComponent();
        }
    }
    
  • Add a DockPanel control to your main form. This is where your tool windows will be docked.

  • To show the tool windows here is the sample code

    ToolWindow myToolWindow = new ToolWindow();
    myToolWindow.Show(this.myDockPanel, DockState.DockLeftAutoHide); // Dock Left & Auto Hide
    
Zuhaib