开发者

Only two panels and the Weifen Luo library

开发者 https://www.devze.com 2022-12-20 03:18 出处:网络
I want to make only two panels like Solution Explorer and toolbox (Visual Studio) in my application.

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
    
0

精彩评论

暂无评论...
验证码 换一张
取 消