The NDockManager controls most of the aspects of visual representation. It exposes the following styles used to control docking framework's appearance:
The following example demonstrates how to change the tabs appearance using the TabStyle property:
C# |
Copy Code
|
---|---|
NTabStyle style = this.nDockManager1.TabStyle; style.TabAlign = TabAlign.Top; style.UseAutomaticTabStyle = false; style.TabStyle = TabStyle.Buttons; style.Font = new Font("Arial", 9.0f); |
Visual Basic |
Copy Code
|
---|---|
Dim style As NTabStyle = Me.nDockManager1.TabStyle style.TabAlign = TabAlign.Top style.UseAutomaticTabStyle = false style.TabStyle = TabStyle.Buttons style.Font = New Font("Arial", 9.0F) |
The result of the above code.
Each element in the docking framework should be attached to a valid NDockManager instance in order to function properly. You should use the manager to create and add docking containers as it will automatically update the container's references. By default when assigned a valid Form instance the manager will add its RootContainer to the Form's controls collection. If you want to add additional nested containers use the manager's AddContainer method.
The following code demonstrates how to add docking containers:
C# |
Copy Code
|
---|---|
//create a valid manager and attach it to the form NDockManager nDockManager1 = new NDockManager(); nDockManager1.Form = this; //create a container NDockingPanelContainer container = this.nDockManager1.AddContainer(DockStyle.Fill); //add the container as a child to an existing docking panel this.nDockingPanel1.Controls.Add(container); |
Visual Basic |
Copy Code
|
---|---|
'create a valid manager and attach it to the form Dim nDockManager1 As NDockManager = New NDockManager() nDockManager1.Form = Me 'create a container Dim container As NDockingPanelContainer = Me.nDockManager1.AddContainer(DockStyle.Fill) 'add the container as a child to an existing docking panel Me.nDockingPanel1.Controls.Add(container) |
The NDockManager component might start batch operation which actually suspends any layout and notification events.
The following code demonstrates how to start and end a batch operation:
C# |
Copy Code
|
---|---|
this.nDockManager1.StartBatchOperation(); //perform your application-defined job here //do not forget to end the batch operation this.nDockManager1.EndBatchOperation(); |
Visual Basic |
Copy Code
|
---|---|
Me.nDockManager1.StartBatchOperation() 'perform your application-defined job here 'do not forget to end the batch operation Me.nDockManager1.EndBatchOperation() |
The NDockManager might be used to perform various updates on the entire docking framework.
The following table describes these methods:
Method | Description |
---|---|
Forces all the panels with visible caption to re-measure and repaint them. |
|
Forces all containers and panels to perform layout. |
|
Notifies all elements in the framework of a palette change. |
|
Invalidates and updates the entire framework. |
|
Invalidates and updates all the splitters in the framework. |
|
Notifies all docking panels that a property regarding tabs appearance has changed. |
|
Performs a batch of all updates. |
The NDockManager keeps track of all the containers and panels currently being part of the framework. It exposes lots of properties and methods to perform various queries upon framework's elements.
The following table demonstrates these queries:
Query | Description |
---|---|
Gets the currently active panel for the framework. There can be only one at a time. |
|
Gets all the containers registered with the framework. Including both visible and hidden. |
|
Gets all the docking panels registered with the framework. Includes panels with any DockState. |
|
Searches for a INDockingPanelContainer with the specified ID. |
|
Searches for a INDockingPanel with the specified ID. |
|
Searches for a INDockZone with the specified ID. |
|
Gets all containers with the specified DockStyle. |
|
Gets all the panels with the specified DockState. |
The NDockManager provides some sharable object to be used by the entire framework. These are: