How do you create a "dockable" form, similar to the windows in Visual Studio?
问题:
回答1:
Any custom control (composite, not inherited) in winforms can be docked, because it's really just a panel underneath. Combine this with a tablelayout panel for the high-level layout of your form and you have all the pieces. But you still have to implement all the glue and supporting UI yourself.
回答2:
I've used Weifen Luo's "DockPanel Suite" to good effect. It's an open source library that mimics Visual Studio's docking system very well, including nested docking, floating windows, tabbed windows, etc. You can download his source and see his approach there, if you'd prefer your own, simpler solution.
Sourceforge project here: http://sourceforge.net/projects/dockpanelsuite
回答3:
We are using Weifen Luo's "DockPanel Suite" for our project and quite happy with it.
回答4:
One of the best ones I've seen and used is SandDock from Divelements, they have both a WinForms and a WPF version.
回答5:
I've used CodeJock's DockingPane ActiveX control to create docking panes before.
回答6:
You'll probably want to consume someone else's component for this purpose rather than trying to roll your own, and there's no native WinForms way to do this.
There is a free library on CodeProject for this purpose, but I haven't tried it.
http://www.codeproject.com/KB/toolbars/DockContainer.aspx