'Declaration Public Class UltraDockManager Inherits Infragistics.Win.UltraComponentControlManagerBase Implements Infragistics.Shared.IUltraComponent, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IUltraControl
public class UltraDockManager : Infragistics.Win.UltraComponentControlManagerBase, Infragistics.Shared.IUltraComponent, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IUltraControl
The UltraDockManager provides Visual Studio .Net style docking functionality, including the ability to unpin/autohide controls. Unpinned controls appear as tab items in the UnpinnedTabArea based on the side of the container that the owning DockAreaPane is docked.
The docking functionality is controlled via 3 types of panes - DockAreaPane, DockableGroupPane and DockableControlPane instances. All 3 derive from DockablePaneBase. DockableControlPanes are the panes which directly contain and manage a specific control. DockableGroupPanes are panes that contain/group 2 or more DockablePaneBase instances. This means that it may contain any DockableControlPanes and other DockableGroupPanes. DockAreaPanes are specialized types of group panes. These panes are the root container for all other panes and may be either floating or docked to any side of the container.
Default settings that will apply to all panes can be set using the DefaultPaneSettings property. This can be overriden for all children of a particular group by modifying the group's DefaultPaneSettings. This can be further controlled at the individual pane level via the Settings. Values are resolved by checking the specific pane's Settings, then checking the DefaultPaneSettings of the DockablePaneBase.Parent and finally the manager's DefaultPaneSettings.
The DockAreas property returns the collection of DockAreaPane instances. Each DockAreaPane contains a collection of DockablePaneBase instances that it contains. These may be either DockableControlPane or DockableGroupPane instances.
The ControlPanes property returns a collection containing all the DockableControlPane instances managed by the component. The control panes within the collection may be referred to via index, key or the associated Control. Additional methods for locating panes include PaneFromControl, PaneFromKey, and PaneFromPosition(Int32,Int32,Boolean).
The ActivePane property will return the DockableControlPane instance that contains the control which currently has the input focus. The PaneActivate and PaneDeactivate can be used to determine when the ActivePane changes.
The information managed by the UltraDockManager can be persisted and restored using the load and save methods. Separate methods exist for persisting the contents of the control to either a SOAP format (LoadFromXML(Stream) and SaveAsXML(Stream)) or to and from binary (LoadFromBinary(Stream) and SaveAsBinary(Stream)).
DesignTime: The UltraDockManager provides full support for design time functionality. Panes may be floated, docked and dragged just as they can at run time. Panes may also be unpinned at design time providing complete WYSIWYG control over the appearance of the product without the need to run the project to organize the panes. Controls may be docked by selecting undocked controls on the form, pressing right click and selecting "Dock Controls". A dialog is displayed to control how and where the controls are grouped. All the selected panes will be group together into a single DockAreaPane. Panes may be undocked by right clicking on a docked control and unchecking the "Dock Controls" option. They may also be undocked by cutting or dragging the docked control out of the DockableControlPane. An additional design time feature is the additional property tab available for docked controls. The property tab is displayed in the Visual Studio Properties window when one or more docked controls are selected. The property tab appears with the same icon as that used for the UltraDockManager. The property tab displays the properties for the DockableControlPane associated with the docked control. This provides a convenient way to change properties for a specific docked pane (e.g. Text).
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDock Private Sub btnInitializeManager_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInitializeManager.Click ' SupportThemes determines if the component will make use of ' the windows themes when the system themes are available and ' enabled. we will disable them to allow custom appearances ' to be set. if true, the system themed captions, buttons, etc ' will be used to render the component Me.ultraDockManager1.SupportThemes = False ' Allowdrop only works in a single threaded apartment ' when enabled, unpinned control panes will flyout when ' dragging (see System.Windows.Forms.Control.DoDragDrop for ' more on drag drop in .net) over the tabs of the unpinned ' panes and will also switch the tabs of docked and floating ' tab groups. Me.ultraDockManager1.AllowDrop = True ' Allow flyout animations - if disabled, the flyout window ' will not appear to slide out but will simply be positioned ' with the appropriate flyout size Me.ultraDockManager1.AnimationEnabled = True ' Add an appearance to the components appearances collection ' the appearance will be saved in any created layouts and ' may be shared by the various appearance properties Dim tabAreaAppearance As Infragistics.Win.Appearance = Me.ultraDockManager1.Appearances.Add("unpinnedTabArea") tabAreaAppearance.BackColor = SystemColors.InactiveCaption tabAreaAppearance.BorderColor = SystemColors.InactiveBorder ' Initialize the unpinned tab area appearance to use this appearance ' object we just created Me.ultraDockManager1.UnpinnedTabAreaAppearance = tabAreaAppearance ' Alter the appearance for the unpinned tab area - this is the ' area around the edge of the hosting control (form or usercontrol) ' that contains the tabs representing the unpinned control panes Me.ultraDockManager1.BorderStyleUnpinnedTabArea = UIElementBorderStyle.Etched ' Set the position for the caption buttons Me.ultraDockManager1.CaptionButtonAlignment = CaptionButtonAlignment.Near ' Soft popup when active Me.ultraDockManager1.CaptionButtonStyle = UIElementButtonStyle.PopupSoftBorderless ' Use VS style captions - this will affect the general appearance ' and colors of the captions as well as the images used for the ' button images Me.ultraDockManager1.CaptionStyle = CaptionStyle.VSNet ' Use layered windows instead of a drag outline - layered windows ' makes use of the Opacity of the form which internally relies upon ' the LayeredWindow api's and therefore is only supported under ' windows 2000. if layered windows are not supported by the os on ' which the app is running, the drag outline will be rendered instead Me.ultraDockManager1.DragWindowStyle = DragWindowStyle.LayeredWindow ' The layered window should be red with a 30% opacity Me.ultraDockManager1.DragWindowColor = Color.Red Me.ultraDockManager1.DragWindowOpacity = 0.3D ' Set the imagelist that will be used by the component. the imagelist ' is used to access images when an appearance's 'Image' property is ' set to an integer and is assumed to be the index of the image ' in the associated imagelist Me.ultraDockManager1.ImageList = Me.imageList1 ' We want to make sure that floating windows are currently displayed. ' this can be set to false to hide the floating windows without hiding ' all of the docked manager's panes. to hide all the panes, use the ' 'Visible' property of the component. Me.ultraDockManager1.ShowFloatingWindows = True ' Prevent the dock manager from showing tooltips. by default, tooltips ' are displayed when the text for a tab or caption is not large enough ' to display the text. Me.ultraDockManager1.ShowToolTips = False ' Make the splitter bars appear a little different from the ' default control color used for the panes so they are more ' noticable Me.ultraDockManager1.SplitterBarAppearance.BackColor = SystemColors.ControlLightLight ' Initialize the border style used for the caption area Me.ultraDockManager1.DefaultPaneSettings.BorderStyleCaption = UIElementBorderStyle.Solid ' The default width for a fixed width tab will be 75 pixels. this ' will only affect the width of tabs' whose GroupSettingsResolved.TabSizing ' is set to 'TabSizing.Fixed'. Me.ultraDockManager1.DefaultPaneSettings.TabWidth = 75 End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDock; using System.Diagnostics; private void btnInitializeManager_Click(object sender, System.EventArgs e) { // SupportThemes determines if the component will make use of // the windows themes when the system themes are available and // enabled. we will disable them to allow custom appearances // to be set. if true, the system themed captions, buttons, etc // will be used to render the component this.ultraDockManager1.SupportThemes = false; // Allowdrop only works in a single threaded apartment // when enabled, unpinned control panes will flyout when // dragging (see System.Windows.Forms.Control.DoDragDrop for // more on drag drop in .net) over the tabs of the unpinned // panes and will also switch the tabs of docked and floating // tab groups. this.ultraDockManager1.AllowDrop = true; // Allow flyout animations - if disabled, the flyout window // will not appear to slide out but will simply be positioned // with the appropriate flyout size this.ultraDockManager1.AnimationEnabled = true; // Add an appearance to the components appearances collection // the appearance will be saved in any created layouts and // may be shared by the various appearance properties Infragistics.Win.Appearance tabAreaAppearance = this.ultraDockManager1.Appearances.Add( "unpinnedTabArea" ); tabAreaAppearance.BackColor = SystemColors.InactiveCaption; tabAreaAppearance.BorderColor = SystemColors.InactiveBorder; // Initialize the unpinned tab area appearance to use this appearance // object we just created this.ultraDockManager1.UnpinnedTabAreaAppearance = tabAreaAppearance; // Alter the appearance for the unpinned tab area - this is the // area around the edge of the hosting control (form or usercontrol) // that contains the tabs representing the unpinned control panes this.ultraDockManager1.BorderStyleUnpinnedTabArea = UIElementBorderStyle.Etched; // Set the position for the caption buttons this.ultraDockManager1.CaptionButtonAlignment = CaptionButtonAlignment.Near; // Soft popup when active this.ultraDockManager1.CaptionButtonStyle = UIElementButtonStyle.PopupSoftBorderless; // Use VS style captions - this will affect the general appearance // and colors of the captions as well as the images used for the // button images this.ultraDockManager1.CaptionStyle = CaptionStyle.VSNet; // Use layered windows instead of a drag outline - layered windows // makes use of the Opacity of the form which internally relies upon // the LayeredWindow api's and therefore is only supported under // windows 2000. if layered windows are not supported by the os on // which the app is running, the drag outline will be rendered instead this.ultraDockManager1.DragWindowStyle = DragWindowStyle.LayeredWindow; // The layered window should be red with a 30% opacity this.ultraDockManager1.DragWindowColor = Color.Red; this.ultraDockManager1.DragWindowOpacity = 0.3d; // Set the imagelist that will be used by the component. the imagelist // is used to access images when an appearance's 'Image' property is // set to an integer and is assumed to be the index of the image // in the associated imagelist this.ultraDockManager1.ImageList = this.imageList1; // We want to make sure that floating windows are currently displayed. // this can be set to false to hide the floating windows without hiding // all of the docked manager's panes. to hide all the panes, use the // 'Visible' property of the component. this.ultraDockManager1.ShowFloatingWindows = true; // Prevent the dock manager from showing tooltips. by default, tooltips // are displayed when the text for a tab or caption is not large enough // to display the text. this.ultraDockManager1.ShowToolTips = false; // Make the splitter bars appear a little different from the // default control color used for the panes so they are more // noticable this.ultraDockManager1.SplitterBarAppearance.BackColor = SystemColors.ControlLightLight; // Initialize the border style used for the caption area this.ultraDockManager1.DefaultPaneSettings.BorderStyleCaption = UIElementBorderStyle.Solid; // The default width for a fixed width tab will be 75 pixels. this // will only affect the width of tabs' whose GroupSettingsResolved.TabSizing // is set to 'TabSizing.Fixed'. this.ultraDockManager1.DefaultPaneSettings.TabWidth = 75; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2