DotNetBar for WinForms Document Docking
In Docking Concepts docking on all 4 sides of the form were covered. This topic covers Fill docking or Document Docking capabilities of DotNetBar Suite. To quickly get started with Document Docking please watch the Document Docking Tutorial on our web site.
Document Docking is enabled by right-clicking DotNetBarManager component on your form and choosing Enable Document Docking. That will create middle, fill dock site which will host your document. Note that by enabling this you will not have any client area left since fill dock site will take over all available client space. Marked area on the picture below illustrate the Document Docking:
Architecture of Document Docking is very similar to regular docking windows. Bar objects with one or more DockContainerItem objects are used to host any control you want. Take a look at the DocumentDocking sample application shipped with DotNetBar inside of Samples folder for an illustration.
Document Docking provides unparalleled docking capabilities so the programmatic interface to our docking engine has been extended to provide easier control over the docking. Docking code for document windows is very simple and operates from the Document dock site that is hosting all document bars. For example to dock a bar named bar1 to the left of the bar named barReference you would use following code:
If dockSite1.IsDocumentDock Then dockSite1.GetDocumentUIManager().Dock(barReference, bar1, eDockSide.Left) End If
Code above assumes that barReference is already docked as a Document. If you do not have reference bar then you can simply use following code:
If dockSite1.IsDocumentDock Then dockSite1.GetDocumentUIManager().Dock(bar1) End If