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 h开发者_高级运维ow it works in the Weifen library. How can I make two dockable panels?
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
精彩评论